-
Notifications
You must be signed in to change notification settings - Fork 9
/
on_cmd_integrationtest.js
50 lines (40 loc) · 1.06 KB
/
on_cmd_integrationtest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var botio = require(process.env['BOTIO_MODULE']);
require('shelljs/global');
var fail = false;
exec('npm ci', {async:false});
silent(true);
//
// Get PDFs from local cache
//
echo();
echo('>> Deploying cached PDF files');
cp(__dirname+'/pdf-cache/*', './test/pdfs');
//
// Deploy custom files
//
echo();
echo('>> Deploying custom files');
cp('-f', __dirname+'/test-files/browser_manifest.json', './test/resources/browser_manifests');
//
// Integration Tests
//
echo();
echo('>> Integration Tests');
exec('npx gulp integrationtest', {silent:false, async:true}, function(error, output) {
var successMatch = output.match(/All integration tests passed/g);
if (successMatch) {
botio.message('+ **Integration Tests:** Passed');
} else {
botio.message('+ **Integration Tests:** FAILED');
fail = true; // non-fatal, continue
}
//
// Update local cache of PDF files
//
echo();
echo('>> Updating local PDF cache')
mkdir('-p', __dirname+'/pdf-cache');
cp('./test/pdfs/*.pdf', __dirname+'/pdf-cache');
if (fail)
exit(1);
}); // exec integration tests