-
Notifications
You must be signed in to change notification settings - Fork 20
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
Enable coverage reporting for test runners #78
Enable coverage reporting for test runners #78
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Depends on onflow/cadence#2296, so need to wait for a release that includes it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
1bb6b46
to
5de7469
Compare
@m-Peter this CI fails, probably need to update the Cadence. |
@sideninja Yes, I think the release flow is probably this:
|
Do you have any ETA on that? |
I was also thinking of randomizing test execution here, with something like: functions := make(
[]*ast.FunctionDeclaration,
len(program.Program.FunctionDeclarations()),
)
copy(functions, program.Program.FunctionDeclarations())
rand.Shuffle(len(functions), func(i, j int) {
functions[i], functions[j] = functions[j], functions[i]
})
for _, funcDecl := range functions {
...
} What are your thoughts on this? |
Hmm I'm not sure how I feel about tests not being deterministic, I can see how you could expose flakiness but at the same time it will be hard to identify the source of it I guess due to different execution. |
@sideninja The plan is to cut a Cadence release today/early this week |
The code coverage seems to be working quite well, with the unit testing functionality provided by the Cadence testing framework. After that, I was toying around with the integration testing functionality, and the |
4706ae1
to
ca0e117
Compare
That's fair, it can be obtrusive if it is done automatically. However, in a stateful paradigm, I think it can uncover some edge cases that are hard to manifest otherwise. If the test suite is executed in a randomized order, the random seed will be printed out, and the developer can then provide this seed, in order to reproduce the failures. |
Yeah, it has an upside to indicate issues, but to my experience the wish for that is usually left to a developer to either state in the tests as part of the testing framework to randomize the execution (which in this case I don't think it will be possible since I don't believe there's an API for it) or by providing an execution flag, which might be applicable here. I will leave the decision to you, just wanted to raise the concern I saw. |
Makes sense 👍 I was also thinking about an execution flag as well, to allow developers to specify a randomized execution order. Let's wait and see what Bastian and Supun think about it also. |
ca0e117
to
cb43a44
Compare
Was #2296 already released? is this still blocked by that? |
@sideninja It was first included in this release: https://github.com/onflow/cadence/releases/tag/v0.34.0 . Let me see if I can get it to work with that version. |
@sideninja Bumping only the |
cb43a44
to
888973b
Compare
Yes, flow-go has been updated. The Emulator was just updated in onflow/flow-emulator#330. The Emulator will need a couple more improvements (see PR feedback), then after it has been released, I think @dsainati1 will continue updating the downstream dependencies, including the tools here. |
#86 should unblock this PR |
I will give it a shot! Thanks for the heads up 🙌 |
Include also the test script name, when printing test results for each script.
888973b
to
700964e
Compare
Well done @turbolent 👏 Rebasing on master, after #86 was merged, seems to have made all checks successful. |
Work towards onflow/developer-grants#132
Complementary PRs:
flow test
command with coverage features flow-cli#827Description
master
branchFiles changed
in the Github PR explorer