Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test) choose suite with consistent env var #9040

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ jobs:
cmd:
- CLIENT=firefox npm run test-webpack
- AUTO_COMPACTION=true npm test
- PERF=1 npm test
- TYPE=performance npm test
- npm run test-unit
- npm run test-component
- npm run test-fuzzy
Expand Down
4 changes: 2 additions & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ using the command:

### Performance tests

The performance test suite is run using the `PERF` variable:
This suite checks some performance metrics. It can be run using the command:

$ PERF=1 npm test
$ TYPE=performance npm test

This supports most of the same options as the integration suite, particularly
the `CLIENT`, `ADAPTERS` and `GREP` options. It has some additional options of
Expand Down
2 changes: 1 addition & 1 deletion bin/repeat-perf-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ iterate_tests() {
log "Running perf tests on $commit with adapter-$adapter..."
SRC_ROOT="../../dist-bundles/$commit" \
JSON_REPORTER=1 \
PERF=1 \
TYPE=performance \
USE_MINIFIED=1 \
MANUAL_DEV_SERVER=1 \
ADAPTERS="$adapter" \
Expand Down
6 changes: 3 additions & 3 deletions bin/test-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (!SUPPORTED_BROWSERS.includes(browserName)) {

var testRoot = 'http://127.0.0.1:8000/tests/';
var testUrl;
if (process.env.PERF) {
if (process.env.TYPE === 'performance') {
testUrl = testRoot + 'performance/index.html';
} else if (process.env.TYPE === 'fuzzy') {
testUrl = testRoot + 'fuzzy/index.html';
Expand Down Expand Up @@ -217,8 +217,8 @@ async function startTest() {
new BenchmarkConsoleReporter(runner);

if (process.env.JSON_REPORTER) {
if (!process.env.PERF) {
console.log('!!! JSON_REPORTER should only be set if PERF is also set.');
if (process.env.TYPE !== 'performance') {
console.log('!!! JSON_REPORTER should only be set if TYPE is set to "performance".');
process.exit(1);
}
new BenchmarkJsonReporter(runner);
Expand Down
2 changes: 1 addition & 1 deletion bin/test-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [ "$COVERAGE" ]; then
TESTS_PATH="tests/{unit,integration,mapreduce,component}/test*.js tests/find/*/test.*.js"
fi

if [ "$PERF" ]; then
if [ "$TYPE" = "performance" ]; then
node tests/performance/index.js
elif [ ! "$COVERAGE" ]; then
# --exit required to workaround #8839
Expand Down
Loading