Replies: 2 comments
-
Can anyone help with this please? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This should work just fine. Can you add some logging in your CI action to make sure the environment variable is actually set? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi - I'm trying to configure some Snapshot Testing to avoid the following scenario:
1. Code is updated, causing a Snapshot Test to break, or a new Snapshot Test has been added, but hasn't been run ever.
2. While the CICD pipeline is running, the Snapshot Test cannot find a matching image, and fails, but gets saved automatically.
3. The CICD pipeline is configured to retry tests three times.
4. The Snapshot saved earlier is now used on the retry of the failed test.
5. The failed test will automatically pass, as it is reading from the automatically recorded Snapshot.
6. This pull request passes CICD, and then gets merged onto the main branch. However, the automatically recorded Snapshot does not get merged.
7. The main branch is now broken, and all new branches made off main are now missing a Snapshot, and cannot pass CICD until a fix is made and merged.
I have successfully prevented this behaviour with the following approach using inheritance/subclassing:
However, I am looking for an alternative way to do this, perhaps by editing my
GITHUB ACTIONS
file or by editing myfastfile
. The reason I want an alternative is that I am worried about a scenario in which other people contributing to my repository might not use theNewTestCase
class, and therefore this behaviour won't be enforced.I have tried to use the
SNAPSHOT_TESTING_RECORD=never
env variable inside myGITHUB ACTIONS
file, but to no avail. Is there something I'm missing as to how I can achieve this, or if this is still way to do it?Alternatively if there's a way to just extend
XCTestCase
globally across my codebase, and enforce this behaviour to differ when tests are being run locally or on pipeline, I would also take that.I will appreciate any advice I can get.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions