Skip to content
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
7 changes: 3 additions & 4 deletions core/service-test-runner/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
// echo "service1\nservice2\nservice3" | npm run test:services -- --stdin
//
// Run tests but skip tests which intercept requests:
// SKIP_INTERCEPTED=TRUE npm run test:services --
// SKIP_INTERCEPTED=true npm run test:services --
//
// Run tests on a given instance:
// SKIP_INTERCEPTED=TRUE TESTED_SERVER_URL=https://test.shields.io npm run test:services --
// SKIP_INTERCEPTED=true TESTED_SERVER_URL=https://test.shields.io npm run test:services --
//
// Run tests with given number of retries and backoff (in milliseconds):
// RETRY_COUNT=3 RETRY_BACKOFF=100 npm run test:services --
Expand Down Expand Up @@ -56,7 +56,6 @@

import fs from 'fs'
import minimist from 'minimist'
import envFlag from 'node-env-flag'
import { createTestServer } from '../server/in-process-server-test-helpers.js'
import Runner from './runner.js'

Expand Down Expand Up @@ -102,7 +101,7 @@ if (process.env.TESTED_SERVER_URL) {
})
}

const skipIntercepted = envFlag(process.env.SKIP_INTERCEPTED, false)
const skipIntercepted = process.env.SKIP_INTERCEPTED === 'true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to give up functionality.

Suggested change
const skipIntercepted = process.env.SKIP_INTERCEPTED === 'true'
const skipIntercepted = process.env.SKIP_INTERCEPTED.trim().toLowerCase() === 'true'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't work, as process.env.SKIP_INTERCEPTED can be undefined; we'd also not be covering the SKIP_INTERCEPTED=1 case, which was technically previously supported.

Given probably no one has used this option in years, I really think we should go with the simplest implementation possible, i.e. the equality check. :)

const runner = new Runner({ baseUrl, skipIntercepted, retry })
await runner.prepare()

Expand Down
13 changes: 1 addition & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"lodash.countby": "^4.6.0",
"matcher": "^6.0.0",
"mvncmp": "^1.0.0",
"node-env-flag": "^0.1.0",
"node-pg-migrate": "^8.0.3",
"parse-link-header": "^2.0.0",
"path-to-regexp": "^6.3.0",
Expand Down
Loading