-
Notifications
You must be signed in to change notification settings - Fork 0
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
Closes #138: Make SCENARIO_URLS
dynamic and depending on the running test
#141
Conversation
@Miraeld @jeawhanlee Thanks for the PR. on PR running |
|
@Mai-Saad Have you modified your own You should have something like : import ScenarioUrls from './scenarioUrls.json';
// ... Rest of your config
const scriptName = process.env.npm_lifecycle_event;
const SCENARIO_URLS = ScenarioUrls[scriptName];
// ... Rest of your config
export {
WP_USERNAME,
WP_PASSWORD,
WP_BASE_URL,
WP_ROOT_DIR,
WP_ENV_TYPE,
WP_DOCKER_CONTAINER,
WP_DOCKER_ROOT_DIR,
WP_SSH_USERNAME,
WP_SSH_ADDRESS,
WP_SSH_KEY,
WP_SSH_ROOT_DIR,
SCENARIO_URLS
}; |
@Miraeld you are right, I was using the old config. updated the config and no references with smoke now 🙏 and with llcssbg references are created |
@Miraeld, @jeawhanlee, @Mai-Saad can confirm this, too. Tested also with |
Description
Fixes #138
This PR introduces a change that allows scenario URLs to be loaded conditionally based on the current test being run. This improves the efficiency of our tests by only loading the URLs that are needed for each test, which can lead to faster test execution and less flakiness on poor internet connections
Type of change
Detailed scenario
To trigger the new code, simply run a test script. The scenario URLs for that specific test will be loaded from a JSON file and used in the test.
Technical description
Documentation
The code works by first importing a JSON file that maps script names to their respective scenario URLs. Then, in the
wp.config.ts
file, it retrieves the current script name usingprocess.env.npm_lifecycle_event
. This script name is used to look up the corresponding scenario URLs in the imported JSON object, and these URLs are assigned toSCENARIO_URLS
.New dependencies
No new dependencies were introduced in this change.
Risks
There are no known performance or security risks associated with this change. The main risk is that if the JSON file or the
wp.config.ts
file is not properly configured, the correct scenario URLs might not be loadedMandatory Checklist
Code validation
Code style
Additional Checks