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

Optimize Backstop Reference Creation in Testing Suites #63

Open
hanna-meda opened this issue Apr 3, 2024 · 5 comments
Open

Optimize Backstop Reference Creation in Testing Suites #63

hanna-meda opened this issue Apr 3, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@hanna-meda
Copy link
Contributor

hanna-meda commented Apr 3, 2024

Is your feature request related to a problem? Please describe.
Currently, we create backstop references for every test run, regardless of whether they are necessary or not. For instance, even when running tests that do not require backstop references, such as npm run test:smoke, we still generate them. This practice consumes unnecessary time during test execution.
The issue is here, within hooks.ts

Describe the solution you'd like
As per discussion with @jeawhanlee, we need to optimize backstop reference creation by generating them only for tests that require them. For instance, backstop references will be created when running tests like npm run test:llcssbg, which necessitate them for comparison during the test run. Conversely, tests like npm run test:smoke, where backstop references are unnecessary, will not trigger their creation, thereby reducing execution time and resource consumption.

@hanna-meda hanna-meda added the enhancement New feature or request label Apr 3, 2024
@hanna-meda hanna-meda changed the title Enhance Custom tag usage for individual scenarios Optimize Backstop Reference Creation in Testing Suites Apr 3, 2024
@jeawhanlee
Copy link
Contributor

Scope a solution ✅

We can conditionally create backstop reference based on script name by getting the current script during runtime and matching it against an array of scripts we allow reference to be created for.
const script = process.env.npm_lifecycle_event; should give us the script e.g test:smoke or test:llcssbg

Estimate the effort ✅
[XS]

@Miraeld
Copy link
Contributor

Miraeld commented Sep 17, 2024

Hello,

Is this the same as #138 ?

@MathieuLamiot
Copy link
Contributor

@jeawhanlee @Miraeld any updates on the question above? Is this a duplicate of #138 ?
Thanks

@jeawhanlee
Copy link
Contributor

It does look like a duplicate with different approach, I'll test this PR to see that it closes this properly.

@jeawhanlee
Copy link
Contributor

Well it is not a duplicated as the backstop reference still runs but with empty scenarios, the aim is not to run the reference for non related test.
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants