toMatchDisk_TODO throws error when writing multiple snapshots to disk during parameterized tests, succeeds on follow ups.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Inizia con il reproducer Kotlin parametrizzato usando selfie-runner-junit5:2.0.1 ed esamina il fallimento in Validator.kt:613. Confronta la prima esecuzione, quando viene creato il file snapshot, con le esecuzioni successive e con il riutilizzo di un _TODO esistente; il lavoro è completato quando è possibile scrivere più snapshot senza l’errore “Snapshot was set to multiple values!”.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am using selfie-runner-junit5:2.0.1 to verify errors for each test case. I my parameters include a unique test case name to pass into toMatchDisk.
The summarized version:
@ParameterizedTest(name = "rejects invalid commands: {1}")
@MethodSource("modifyNodeItemsValidationCases")
fun `rejects invalid commands`(
cmd: Command,
testcaseName: String,
) = runTest {
val thrown = shouldThrow<TraitStandardResponseException> {
validate(cmd)
}
thrown.response.respCase shouldBe RespCase.RESPONSE_BAD_REQUEST
Selfie.expectSelfie(thrown.message.toString()).toMatchDisk(testcaseName)
}
When I run this test case, the snapshot file is successfully written:
╔═ rejects invalid commands/Child node not found ═╗
ModifyItem must have a valid item case to modify
╔═ rejects invalid commands/Empty modify item ═╗
ModifyItem must have a valid item case to modify
╔═ rejects invalid commands/Empty modify node item ═╗
ModifyNodeItemWithAddition must have either modifyItem, updateExistingTraits, modifyChildElectricalConnectionPoints, or upstreamElectricalConnectionPoint
╔═ rejects invalid commands/No UtilityMeterNode when trying to edit a utility meter node ═╗
No UtilityMeterNode item found for node id 1 in topology
╔═ rejects invalid commands/Node not found ═╗
Provided node id 1 not in topology
╔═ rejects invalid commands/empty modifyDownstreamElectricalConnectionPoint ═╗
ModifyItem must have a valid item case to modify
╔═ rejects invalid commands/empty simpleElectricalConnectionPoint ═╗
ModifyItem must have a valid item case to modify
╔═ [end of file] ═╗
But the first run fails with this error:
org.opentest4j.AssertionFailedError: Snapshot was set to multiple values!
first time: ValidatorTest$rejects invalid commands$1.invokeSuspend(Validator.kt:613)
this time: ValidatorTest$rejects invalid commands$1.invokeSuspend(Validator.kt:613)
Once the file is created things seem to work:
- Subsequent test runs pass
- If I modify one or more of the expected value and include
//selfieoncethe updates are made and tests pass - Add one or more new test case with
//selfieonce
I can produce the same errors again if the file exists if I ever reuse the _TODO.
- Lingua principale
- Kotlin
- Stelle
- 101
- Fork
- 18
- Merge medio
- 6g 11h
- PR unite (30g)
- 5
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di diffplug/selfie
-
Selfie JVM Snapshot Garbage Collection is overly zealous when using multiple test suites in gradle Apertabug jvm
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
enhancement jvm
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
bug jvm
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
bug docs jvm
Difficoltà 2/5 1-3 ore Idoneità per principianti 50/100
-
bug jvm py
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
Tutte le issue di diffplug/selfie
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
index-request triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Anthonyy232/Paperize#614 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
🌑 nextgen
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
CCBlueX/LiquidBounce#9214 · 1 commento ·