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
New canGenerateNewSnapshots
to avoid automatically creating missing ones in CI
#768
base: main
Are you sure you want to change the base?
Conversation
Bump? |
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * fix * beta 6 * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * fix * wip * wip * wip * wip * wip * wip * wip * wip * wip * small things * wip * DocC + swift-format (#765) * DocC and swift-format support * wip * wip * wip --------- Co-authored-by: Brandon Williams <mbrandonw@hey.com>
I had a related idea and stumbled across this searching issues for it. I was looking for a way to record only the snapshots for the failing tests to avoid re-recording all the snapshots in a project. Mainly to avoid unrelated changed being applied and the back and forth of intel/apple silicon shaping out images. This is just an idea, feel free to take or leave it. We could introduce a enum RecordingMode {
/// Only record a snapshot when there isn't an existing one. The default behaviour.
case missingSnapshots
/// Record the snapshots only for failing tests. Useful for when a change affects many
/// snapshots across a project but you don't want the snapshots for the passing tests
/// to be recorded as well.
case failingTests
/// Always record snapshots. The same as setting `isRecording` to true.
case always
/// Never record a snapshot. The same as setting `canGenerateNewSnapshots` to true.
case never
} This could be introduced without being a breaking change by modifying public var isRecording: Bool {
get { recordingMode == .always }
set { recordingMode = newValue ? .always : .missingSnapshot }
} |
Fixes #748.