diff --git a/bin/localTest.js b/bin/localTest.js new file mode 100644 index 0000000..ee7a9ce --- /dev/null +++ b/bin/localTest.js @@ -0,0 +1,22 @@ +#!/usr/bin/env node + +// Cross platform replacement for `gulp testVisual --env=local --branch=`git rev-parse --abbrev-ref HEAD`` +// Command substitution with backticks does not work on Windows (cmd.exe), so resolve the +// branch name here and forward any extra arguments through to gulp. + +const { execFileSync, spawnSync } = require('child_process') + +const branch = execFileSync('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { encoding: 'utf8' }).trim() + +const result = spawnSync( + 'gulp', + ['testVisual', '--env=local', `--branch=${branch}`, ...process.argv.slice(2)], + { stdio: 'inherit', shell: true } +) + +if (result.error) { + console.error(result.error.message) + process.exit(1) +} + +process.exit(result.status === null ? 1 : result.status) diff --git a/package.json b/package.json index f13166c..b49cec1 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lint": "gulp lint", "serve": "gulp serve", "test": "npm run localTest", - "localTest": "gulp testSpecs && gulp testVisual --env=local --branch=`git rev-parse --abbrev-ref HEAD`", + "localTest": "node ./bin/localTest.js", "gatherDiffs": "rm -rf .tmp/diffs; mkdir -p .tmp/diffs/; BRANCH=`git rev-parse --abbrev-ref HEAD` && for I in `find theSrc/test/snapshots/local/$BRANCH -type d -name __diff_output__`; do cp $I/* .tmp/diffs/ 2> /dev/null; done; true", "gatherMasterDiffs": "rm -rf .tmp/diffs; mkdir -p .tmp/diffs/; for I in `find theSrc/test/snapshots/local/master -type d -name __diff_output__`; do cp $I/* .tmp/diffs/ 2> /dev/null; done; true", "macOpenDiffs": "open .tmp/diffs", diff --git a/theSrc/internal_www/data/functional_tests/north_south_axial_data.json b/theSrc/internal_www/data/functional_tests/north_south_axial_data.json new file mode 100644 index 0000000..56aa527 --- /dev/null +++ b/theSrc/internal_www/data/functional_tests/north_south_axial_data.json @@ -0,0 +1,46 @@ +{ + "coreNodes": [ + [1,-4], + [1,-3], + [1,-2], + [1,-1], + [1, 0], + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + "coreLabels": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I" + ], + "surfaceNodes": [ + [1,-4], + [1,-3], + [1,-2], + [1,-1], + [1, 0], + [1, 1], + [1, 2], + [1, 3], + [1, 4] + ], + "surfaceLabels": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I" + ] +} \ No newline at end of file diff --git a/theSrc/test/snapshotTestDefinitions/functional_tests/north_south_axial_data.yaml b/theSrc/test/snapshotTestDefinitions/functional_tests/north_south_axial_data.yaml new file mode 100644 index 0000000..7020ad4 --- /dev/null +++ b/theSrc/test/snapshotTestDefinitions/functional_tests/north_south_axial_data.yaml @@ -0,0 +1,10 @@ +version: 1 +title: north_south_axial_data +general_comments: [] +width: 500 +height: 500 +type: single_page_one_example_per_config +comments: [] +data: data.functional_tests.north_south_axial_data +config: + - '{}' diff --git a/theSrc/test/snapshots/ci/master/testPlans/functional_tests/north_south_axial_data.png b/theSrc/test/snapshots/ci/master/testPlans/functional_tests/north_south_axial_data.png new file mode 100644 index 0000000..4d8eb4b Binary files /dev/null and b/theSrc/test/snapshots/ci/master/testPlans/functional_tests/north_south_axial_data.png differ diff --git a/theSrc/test/snapshots/ci/master/testPlans/minimal/minimal_data_functional_tests_north_south_axial_data.png b/theSrc/test/snapshots/ci/master/testPlans/minimal/minimal_data_functional_tests_north_south_axial_data.png new file mode 100644 index 0000000..cebcf57 Binary files /dev/null and b/theSrc/test/snapshots/ci/master/testPlans/minimal/minimal_data_functional_tests_north_south_axial_data.png differ