Run service tests on a given (remote) instance; test on [jetbrains] (#2195)

* Allow to run service tests for remote shields instance

* Allow to run service tests for remote shields instance - doc

* Load testedServerUrl from env variable

* Load 'skipIntercepted' flag from env variable
This commit is contained in:
Marcin Mielnicki
2018-11-25 15:51:57 +01:00
committed by GitHub
parent 72955abac7
commit c72e366895
4 changed files with 50 additions and 3 deletions

View File

@@ -9,6 +9,12 @@
// Alternatively, pass a newline-separated list of services to stdin.
// echo "service1\nservice2\nservice3" | npm run test:services -- --stdin
//
// Run tests but skip tests which intercept requests:
// 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 --
//
// Service tests are run in CI in two cases: scheduled builds and pull
// requests. The scheduled builds run _all_ the service tests, whereas the
// pull requests run service tests designated in the PR title. In this way,

View File

@@ -1,5 +1,11 @@
'use strict'
const envFlag = require('node-env-flag')
module.exports = {
port: 1111,
get testedServerUrl() {
return process.env.TESTED_SERVER_URL || `http://localhost:${this.port}`
},
skipIntercepted: envFlag(process.env.SKIP_INTERCEPTED, false),
}