-
Notifications
You must be signed in to change notification settings - Fork 16
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
Refactor the integration testing code #549
base: main
Are you sure you want to change the base?
Conversation
@ozgurakgun Please review |
Thank you for improving the docs as part of this :) |
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.
LGTM, aside from some minor nitpicks!
0f12bf2
to
45edb56
Compare
6d06e84
to
73bd17f
Compare
In PR #421, tests were unintentionally passing due to expected files being overwritten regardless of whether the generated solutions matched Conjure’s solutions. This commit refactors the integration_test_inner function and related file I/O utilities so that: * When ACCEPT=false, tests still compare generated outputs (parse, rewrite, solutions, and traces) against the expected results as before. * When ACCEPT=true, tests now first verify that the generated solutions match the Conjure solutions. Only if they match are the expected files updated. If they don’t match, the test fails without updating the expected files.
73bd17f
to
60087ab
Compare
Code and Documentation Coverage ReportDocumentation CoverageThis PR: conjure_core: 4% with examples, 49% documented -- 8/98/223 Main: conjure_core: 4% with examples, 49% documented -- 8/98/223 View full documentation coverage for main, this PR Code Coverage SummaryThis PR: Detailed Report
Main: Detailed Report
Coverage Main & PR Coverage ChangeLines coverage changed by 0.20% and covered lines changed by -14
Functions coverage changed by 0.00% and covered lines changed by 0
Branches... coverage: No comparison data available |
I am not sure of this one yet @YehorBoiar - I feel we can tidy this up a bit more, but I need to spend a bit more time formulating my thoughts. Thanks for the work so far! |
Maybe we need to think deeper about how we customise each stage of the tester. Currently we have the following steps
(thanks Yehor for documenting this) We could think about all the other stuff the tester does as stages too: 1a. Parse These steps fall into two categories:
Thinking of everything as steps would make configuration simpler. For each optional step, we would parse a |
It would also be nice to have parser only tests : e.g. for treesitter development or for when I'm adding more complicated stuff to the AST. Also no-solver tests so I can test normalisation rule PRs. A possible approach for the above:
This is a vague, high level proposal, so I'm happy to give a more concrete example in Rust. |
(1) The steps having a similar shape to each other, maybe a step abstraction that takes in a function and implements the generate/check-against/accept logic once is closer to what I am thinking. (2) We can also think about a global properties/assertions/warnings structure. That is enabled/disabled depending on what we are looking for in a particular run. An example is the I have been looking into the existing tracing libraries for (2) but didn't manage to find one that does everything I think we need. I think we need named properties, registered centrally (maybe through codegen) and when at call site we decide how to interpret each property. (1) is this PR, (2) is a separate but related one... |
To clarify, these need to be dynamic, not static? If build time is fine, feature flags and simple declarative macros could take us most the way there... Can we store these flags in the As we have serde, it would be easy to set these flags through a # config.toml
[test]
# test settings here
rewriter= "naive"
[debug_flags]
# conjure oxide debug settings here
debug_check_only_one_applicable_rule= true For example, we could parse the debug_flags section into a |
Moving our existing properties to the context and making it serialisable from the test toml should be possible to do immediately without too much effort. Adding macros / a nicer API would hopefully then go on top of our existing stuff without much large scale refactoring. |
dynamic as in runtime instead of compile time, yes. I expect we won't change this during a run, but I guess it should be possible. A kind of debugging option where we increase the message levels during a run could be useful. putting them in context is fine. |
The pull request is marked as stale because it has been inactive for 30 days. If there is no new activity it will be automatically closed in 5 days. |
This PR is created to address the issue #523