Add test-suite-source-dir flag to new test runner
The current tests try to figure out the root directory and then glob
for _test.ts files within there, but this breaks easily if the folder
structure isn't exactly as expected. Instead we can set this via a
flag in the test runner.
This CL only updates the interaction tests, which use the new runner.
e2e tests will be supported in time.
Bug: chromium:1186163
Change-Id: I198b67bf0081ce7334c40d7d661fb8642c2d56d0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2772045
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
diff --git a/scripts/component_server/server.js b/scripts/component_server/server.js
index 358179d..bcbaad8 100644
--- a/scripts/component_server/server.js
+++ b/scripts/component_server/server.js
@@ -7,19 +7,8 @@
const path = require('path');
const parseURL = require('url').parse;
const {argv} = require('yargs');
+const {getTestRunnerConfigSetting} = require('../test/test_config_helpers.js');
-function getTestRunnerConfig() {
- try {
- return JSON.parse(process.env.TEST_RUNNER_JSON_CONFIG);
- } catch {
- // Return an empty object so any lookups return undefined
- return {};
- }
-}
-function getTestRunnerConfigSetting(settingKey, fallbackValue) {
- const config = getTestRunnerConfig();
- return config[settingKey] === undefined ? fallbackValue : config[settingKey];
-}
const serverPort = parseInt(process.env.PORT, 10) || 8090;
const target = argv.target || process.env.TARGET || 'Default';