CQS: gerrit integration

This is for Hannah to hook gerrit up with the test script for the client
app. Also, it scopes the selenium test in /spec/selenium/client_apps for
consistency.

  - canvas build task no longer installs production-only npm packages

Closes CNVS-15443

Change-Id: I0623b594782c55490e12dffdd379bf2baf5fb3a3
Reviewed-on: https://gerrit.instructure.com/40940
Reviewed-by: Hannah Bottalla <hannah@instructure.com>
Product-Review: Hannah Bottalla <hannah@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Hannah Bottalla <hannah@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
This commit is contained in:
Ahmad Amireh 2014-09-11 15:53:13 +03:00 committed by Hannah Bottalla
parent a1f400e754
commit 64f272123d
6 changed files with 29 additions and 11 deletions

View File

@ -0,0 +1,16 @@
#!/usr/bin/env node
var path = require('path');
var root = path.join(__dirname, '..');
var grunt;
// Use the app root as the CWD so that grunt can read the Gruntfile there:
process.chdir(root);
// Make sure we load the development tasks (override any CLI flags):
process.env.production = false;
process.env.NODE_ENV = 'development';
// Run the "test" grunt task:
grunt = require(path.join(root, 'node_modules', 'grunt', 'lib', 'grunt'));
grunt.tasks('test');

View File

@ -6,8 +6,10 @@ define([
var config = ProductionConfig || {};
//>>excludeStart("production", pragmas.production);
console.log('Environment:', this.__TESTING__ ? 'test' : 'development');
// Install test config:
if (window.__TESTING__) {
if (this.__TESTING__) {
require([ './config/environments/test' ], function(testConfig) {
config = _.extend(config, testConfig);
});

View File

@ -1,6 +1,8 @@
/* global launchTests: false */
localStorage.clear();
this.__TESTING__ = true;
require([ 'config/initializer' ], function(initialize) {
initialize().then(launchTests);
});

View File

@ -24,13 +24,13 @@ requirejs.config({
'jasmine_react',
'jasmine_rsvp',
'jasmine_xhr',
// this script actually starts the tests, must be the last one:
'test/boot'
],
waitSeconds: 1,
waitSeconds: 5,
callback: function() {
this.__TESTING__ = true;
// Avoid infinite loop in the pretty printer when trying to print objects with
// circular references.
jasmine.MAX_PRETTY_PRINT_DEPTH = 3;
@ -40,7 +40,5 @@ requirejs.config({
// the app before any of the specs are run.
this.launchTests = this.launchTest;
this.launchTest = function() {};
require([ 'test/boot' ], function() {});
}
});

View File

@ -149,8 +149,8 @@ namespace :js do
puts "Building client app '#{app_name}'"
begin
puts "\tRunning 'npm install --production'..."
output = `npm install --production`
puts "\tRunning 'npm install'..."
output = `npm install`
unless $?.exitstatus == 0
puts <<-MESSAGE
-------------------------------------------------------------------
@ -164,8 +164,8 @@ namespace :js do
end
begin
puts "\tRunning 'npm run build --production'..."
output = `npm run build --production`
puts "\tRunning 'npm run build'..."
output = `npm run build`
unless $?.exitstatus == 0
puts <<-MESSAGE
-------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
require File.expand_path(File.dirname(__FILE__) + '/../helpers/quizzes_common')
describe "canvas quiz statistics" do
include_examples "quizzes selenium tests"