You are viewing a read-only archive of the Blogs.Harvard network. Learn more.

Integrating Jasmine with Travis CI

One of the things I’ve been wanting to automate with our Harmony Lab project is the javascript test suite so that it runs via Travis CI. I tried once before, but hit a wall and abandoned the effort. I recently had the opportunity to work on this as part of a professional development day in ATG, which is an excellent practice that I think all departments should embrace, but that’s a topic for another day. If you’re not familiar with Travis, it’s a free continuous integration service that provides hooks for github so that whenever you push to a branch, it can run some tests and return pass/fail (among other things). Getting this to work with a suite of python unit tests is easy enough according to the docs, but incorporating javascript tests is less straightforward.

Harmony Lab JS tests use the Jasmine testing framework and all of the unit tests are created as RequireJS modules. This is nice because each unit test, which I’ll call a spec file, independently defines the dependencies it needs and then loads them asynchronously (if you’re not using RequireJS, I highly recommend it!). Running the Harmony Lab tests locally is a simple matter of pointing your browser to http://localhost:8000/jasmine. This makes a request to Django which traverses the spec directory on the file system and finds all spec files, and then returns a response that executes all of the specs and reports the results via jasmine’s HTMl reporter. But for headless testing, we don’t want to be running a django server unless it’s absolutely necessary. It would be nice if we could just execute some javascript in a static html page.

It turns out, we can! The result of integrating jasmine with phantomjs and travis CI is Harmony Lab Pull Request #39. You can check out the PR for all the nitty-gritty details. The main stumbling block was getting requirejs to play nicely with phantomjs and getting the specs to load properly. The phantomjs javascript code, that is, the javascript that controls the browser, was the simplest part since it only needed to listen for the final pass/fail message from jasmine via console.log and then propagate that to travis.

Posted in Continuous Integration, Harmony Lab, Javascript. Comments Off on Integrating Jasmine with Travis CI »

Basic LTI Tutorial Using PHP

Introduction

This tutorial will get you up and running with a development environment, complete with a virtual machine running an Apache 2 server with PHP, a basic LTI library written in PHP, and a simple basic LTI-compliant LMS. By the end of the tutorial, you will have written a simple “Hello, World!” LTI tool, and you will be ready to delve into the world of LTI coding. Please note that we assume you already have the following knowledge:

  • An understanding of directories and files, and how to navigate through them using a terminal window on your operating system;
  • How to install software packages on your operating system;
  • An understanding of fundamental web concepts, such as HTML, CSS, HTTP requests, POST requests, etc.
  • Some experience in setting up web servers;
  • Basic knowledge of PHP;
  • An understanding of basic LTI concepts and, in particular, the Basic LTI (v1.0) specifications.

Ready to begin? No? Then grab some coffee or another refreshing beverage. We’ll wait. . .

Ready now? We hope so! Because we’re getting started.

(more…)

Pages: 1 2 3 4

Posted in LTI. Comments Off on Basic LTI Tutorial Using PHP »

PeopleSoft and Star Trek

When I first encountered peoplesoft, I was woefully underwhelmed. Like something a newbie PHP person would have written 10 years prior. In fact, I’ve worked with dozens of similarly functioning sites over the years, so it honestly wasn’t a big deal.

I think I first noticed it was a big deal when I got an email about a year ago from HR, saying they’d give bonuses to people who referred Java and PeopleSoft professionals. That got me to thinking PeopleSoft and Java developers were roughly equivalent. I noticed the positions for them were being posted at roughly the same grade. I didn’t think much of it beyond that.

Recently I figured out what PeopleSoft development actually is. It’s not coding at all. It’s configuration management. Not too far removed from someone who can work in Drupal. I was floored. Not because there’s anything wrong with that, but because such a focus was being put on configuration over custom. I find this both refreshing and scary.

WilWheatonI woke up the other night and couldn’t get back to sleep thinking about this. Was this the future of web development? Configuration management? Was web development eventually going to become 90% “PeopleSoft”? I’ve even been thinking it made sense because Welsey Crusher — while gifted — was not the kind of person I saw coding the woman in red in C. That would require a team of developers. Sure, maybe there’s some awesome libs in the future, but more likely programming in the future will be tantamount to drag and drop. I mean, think about how they controlled the Holodeck, they were giving basic commands, parameters and values. Voice activated PeopleSoft.

Eventually hardware will get better and better, and the bloat of PeopleSoft and like platforms will be less of an inhibitor.

Eventually is a ways away though. Today, speed is paramount. Users demand immediate gratification, and that requires optimization. And PeopleSoft can’t meet user expectations in that way. So it just remains a corporate institution. Something people will put up with because that’s what’s been sold to them.