Skip to content

Commit

Permalink
Fixing build tests for packaged D8/Composer assets.
Browse files Browse the repository at this point in the history
  • Loading branch information
arithmetric authored and unrblt committed Sep 3, 2016
1 parent 910cca1 commit 0787e3e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/Gruntconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"srcFiles": ["!sites/*/files/**", "!xmlrpc.php", "!modules/php/*"],
"projFiles": ["README*", "bin/**", "hooks/**", "src/*.make", "vendor/**"],
"dest": {
"docroot": "www/html",
"docroot": "build/html",
"devResources": ""
}
},
Expand Down
11 changes: 9 additions & 2 deletions test/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ describe('grunt', function() {
});

describe('Packaging', function() {
var drupalCore = process.env.GDT_DRUPAL_CORE;

// Package commands can take excessive time (> 10 minutes for D8).
// Before testing them, remove the bulk of the Drupal codebase.
before(function(done) {
Expand All @@ -198,24 +200,29 @@ describe('grunt', function() {
});

it('should place the build codebase in build/packages/package by default', function(done) {
this.timeout(180000);
exec('grunt package', function(error) {
fs.exists('build/packages/package/build/html/index.php', function(exists) {
var indexPackageDest = (drupalCore === '8') ? 'build/packages/package/build/html/index.php' : 'build/packages/package/index.php';
fs.exists(indexPackageDest, function(exists) {
assert.ok(!error && exists);
done();
});
});
});

it('should allow override of grunt package destination with --name', function(done) {
this.timeout(180000);
exec('grunt package --name=upstream', function(error) {
fs.exists('build/packages/upstream/build/html/index.php', function(exists) {
var indexPackageDest = (drupalCore === '8') ? 'build/packages/upstream/build/html/index.php' : 'build/packages/upstream/index.php';
fs.exists(indexPackageDest, function(exists) {
assert.ok(!error && exists);
done();
});
});
});

it('should compress the package with grunt package:compress', function(done) {
this.timeout(180000);
exec('grunt package:compress --name=archive', function(error) {
fs.exists('build/packages/archive.tgz', function(exists) {
assert.ok(!error && exists);
Expand Down
2 changes: 1 addition & 1 deletion test/test_assets_d8/Gruntconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"srcFiles": ["!sites/*/files/**", "!xmlrpc.php", "!modules/php/*"],
"projFiles": ["README*", "bin/**", "hooks/**", "src/*.make", "vendor/**"],
"dest": {
"docroot": "www/html",
"docroot": "build/html",
"devResources": ""
}
},
Expand Down

0 comments on commit 0787e3e

Please sign in to comment.