Skip to content

Commit

Permalink
Merge pull request #1304 from onflow/ianthpun/flaky-test-fix
Browse files Browse the repository at this point in the history
use assert.Contains for result.OneLiner() check to fix flaky test
  • Loading branch information
ianthpun authored Dec 13, 2023
2 parents cfc51e9 + cce9976 commit d910d27
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions internal/test/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,18 @@ Seed: 1521
assert.NoError(t, result.Results[scriptPassing.Filename][0].Error)
assert.Error(t, result.Results[scriptFailing.Filename][0].Error)
assert.ErrorAs(t, result.Results[scriptFailing.Filename][0].Error, &stdlib.AssertionError{})
assert.Equal(

assert.Contains(
t,
result.Oneliner(),
"Test results: \"./testScriptSimple.cdc\"\n- PASS: testSimple",
)
assert.Contains(
t,
"Test results: \"./testScriptSimple.cdc\"\n- PASS: testSimple\nTest results: \"./testScriptSimpleFailing.cdc\"\n- FAIL: testSimple\n\t\tExecution failed:\n\t\t\terror: assertion failed\n\t\t\t --> 7465737400000000000000000000000000000000000000000000000000000000:5:12\n\t\t\t\n",
result.Oneliner(),
"Test results: \"./testScriptSimpleFailing.cdc\"\n- FAIL: "+
"testSimple\n\t\tExecution failed:\n\t\t\terror: assertion failed\n"+
"\t\t\t --> 7465737400000000000000000000000000000000000000000000000000000000:5:12",
)
})

Expand Down

0 comments on commit d910d27

Please sign in to comment.