Move building Newsletter tests to their job
[MAILPOET-6178]
This commit is contained in:
committed by
Rostislav Wolný
parent
e2e1346649
commit
784d7c1189
@@ -330,6 +330,7 @@ jobs:
|
|||||||
name: 'JS Newsletter Editor Tests'
|
name: 'JS Newsletter Editor Tests'
|
||||||
command: |
|
command: |
|
||||||
mkdir test-results/mocha
|
mkdir test-results/mocha
|
||||||
|
./do compile:js --env production --only-tests
|
||||||
./do t:newsletter-editor test-results/mocha/newsletter_editor_junit.xml
|
./do t:newsletter-editor test-results/mocha/newsletter_editor_junit.xml
|
||||||
- run:
|
- run:
|
||||||
name: 'JS Tests'
|
name: 'JS Tests'
|
||||||
|
@@ -198,15 +198,17 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
return $collection->run();
|
return $collection->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function compileJs($opts = ['env' => null, 'skip-tests' => false]) {
|
public function compileJs($opts = ['env' => null, 'skip-tests' => false, 'only-tests' => false]) {
|
||||||
if (!is_dir('assets/dist/js')) {
|
if (!is_dir('assets/dist/js')) {
|
||||||
mkdir('assets/dist/js', 0777, true);
|
mkdir('assets/dist/js', 0777, true);
|
||||||
}
|
}
|
||||||
$this->_exec('rm -rf ' . __DIR__ . '/assets/dist/js/*');
|
if (!$opts['only-tests']) {
|
||||||
|
$this->_exec('rm -rf ' . __DIR__ . '/assets/dist/js/*');
|
||||||
|
}
|
||||||
$env = ($opts['env']) ?
|
$env = ($opts['env']) ?
|
||||||
sprintf('./node_modules/.bin/cross-env NODE_ENV="%s"', $opts['env']) :
|
sprintf('./node_modules/.bin/cross-env NODE_ENV="%s"', $opts['env']) :
|
||||||
null;
|
null;
|
||||||
return $this->_exec($env . ' ./node_modules/webpack/bin/webpack.js --env BUILD_TESTS=' . ($opts['skip-tests'] ? 'skip' : 'build'));
|
return $this->_exec($env . ' ./node_modules/webpack/bin/webpack.js --env BUILD_TESTS=' . ($opts['skip-tests'] ? 'skip' : 'build') . '--env BUILD_ONLY_TESTS=' . ($opts['only-tests'] ? 'true' : 'false'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function compileCss($opts = ['env' => null]) {
|
public function compileCss($opts = ['env' => null]) {
|
||||||
|
@@ -265,6 +265,7 @@ const publicConfig = {
|
|||||||
// Newsletter Editor Tests Config
|
// Newsletter Editor Tests Config
|
||||||
const testConfig = {
|
const testConfig = {
|
||||||
name: 'test',
|
name: 'test',
|
||||||
|
mode: PRODUCTION_ENV ? 'production' : 'development', // Add mode directly to testConfig
|
||||||
entry: {
|
entry: {
|
||||||
vendor: 'webpack-vendor-index.jsx',
|
vendor: 'webpack-vendor-index.jsx',
|
||||||
testNewsletterEditor: [
|
testNewsletterEditor: [
|
||||||
@@ -529,6 +530,12 @@ module.exports = (env) => {
|
|||||||
if (env && env.BUILD_TESTS === 'build') {
|
if (env && env.BUILD_TESTS === 'build') {
|
||||||
configs.push(testConfig);
|
configs.push(testConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If only the test build is requested
|
||||||
|
if (env && env.BUILD_ONLY_TESTS === 'true') {
|
||||||
|
return [testConfig];
|
||||||
|
}
|
||||||
|
|
||||||
return configs.map((conf) => {
|
return configs.map((conf) => {
|
||||||
const config = Object.assign({}, conf);
|
const config = Object.assign({}, conf);
|
||||||
if (
|
if (
|
||||||
|
Reference in New Issue
Block a user