Test completion schema wrapper#134
Conversation
|
Thanks for directly looking into it:) I do not know if you have already accounted for it but I think this also needs to be updated .github/workflows/update_4C_metadata_schema_file.yaml? EDIT: correct link https://github.com/4C-multiphysics/fourcipp/blob/main/.github/workflows/update_4C_metadata_schema_file.yaml |
|
@davidrudlstorfer Yes, I am aware of that. This PR does everything else except downloading the file. This is why this PR includes its own completion schema still. I mainly wanted to check that testing works on all OS etc., before I download the file in the nightly test, revert the last commit of this PR and then re-run the tests here which then should work. |
de24138 to
5d67d9c
Compare
|
I ended up moving the schema Now ready to merge as soon as the completion schema gets updated. |
|
Thanks for also looking into the performance, do you have a clue why the code checks, i.e., typo check fails? |
|
The pre-commit wanted to modify the completion schema included in this PR, which obviously makes no sense. Since this will vanish before merging anyway in favor of the then downloaded completion schema, it's no concern. If the completion schema download works tonight, I will remove the last commit of this PR, then all tests should pass. |
5d67d9c to
7f5cab6
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates FourCIPP’s validation and test configuration to support running the test suite against a “completion-oriented” JSON schema (including the case where that schema is a wrapper referencing another schema), and wires these new profiles into CI so both schemas get exercised.
Changes:
- Prebuild and store
jsonschema_rsvalidators on the activeConfigProfile, including a “sections-only” variant with top-level requiredness removed. - Add new config profiles for completion schemas (local and docker) and run pytest under those profiles in GitHub Actions.
- Adjust sorting/ordering logic and tests to use resolved
required_sectionsinstead of directly readingschema["required"].
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/fourcipp/test_fourc_input.py | Expands docker-only tests to run under an additional docker completion-schema profile; uses resolved required sections in ordering test. |
| src/fourcipp/utils/validation.py | Changes validation helper to accept a prebuilt jsonschema_rs.Validator instead of building from a schema dict each call. |
| src/fourcipp/utils/configuration.py | Adds resolved required-sections handling, builds/stores validators, and introduces helper methods for wrapper schemas. |
| src/fourcipp/fourc_input.py | Uses CONFIG.required_sections for ordering and switches validation to use prebuilt validators (removes per-call schema munging). |
| src/fourcipp/config/config.yaml | Adds completion-schema profiles for local and docker use. |
| .github/workflows/run_testsuite.yaml | Runs pytest twice (full schema + completion schema) and adds docker job coverage for the completion-schema profile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7f5cab6 to
a5b3142
Compare
|
All tests pass using the completion schema from last night. Now ready for review @davidrudlstorfer |
davidrudlstorfer
left a comment
There was a problem hiding this comment.
@rjoussen thanks a lot for also updating everything here in FourCIPP. The code changes all look good and ready to merge.
I only have one last comment/favour: I compared the performance results of the last run with your changes to the performance (timings) of the last scheduled run and the new changes worsened nearly all timings across the board.
The performance of reading and dumping files should stay rather consistent. Especially with large meshes it's important that we do not get any performance degradation. (For example in BeamMe we test dumping of large meshes/input files with FourCIPP)
Could you point me to which exact timings you are comparing? Are they something directly within the tests? The pipeline in total now takes significantly longer which is expected though, since we're testing everything twice. |
https://github.com/4C-multiphysics/fourcipp/actions/runs/26708126931 |
a714b29 to
73025a6
Compare
|
Okay, I solved it, the timings of this PR are now (ubuntu-latest, python 3.13): #134 https://github.com/4C-multiphysics/fourcipp/actions/runs/26774729688?pr=134
versus the last nightly test: https://github.com/4C-multiphysics/fourcipp/actions/runs/26749752814
The issue was likely that I unnecessarily stored a full 4C schema in memory. The expensive full validator is still built centrally in configuration.py, but now only lazily on the first call. |
6ad585e to
7d8f607
Compare
This also moves validator creation and schema resolution of requied sections to configuration.py, such that it only happens once during testing.
7d8f607 to
67787ab
Compare
|
Okay, the performance deterioration is removed now. Technically, this is ready to merge now, but it seems fourcipp wants all previous matrix tests to pass. That's quite a bad setup, imo, because it makes it really hard to change anything in the test matrix. The reason I changed it is that the full and completion schema should have separate tests, so we can see performance separately (and not just the last performance as before). I changed it to an |
Yes there's no easy way to prevent this. There is the possibility to set it up like in 4C with a dedicated "all tests passed" stage but this is more work to setup. I can update the required tests tomorrow or simply ignore the check as an admin. I will have a closer look at the PR tomorrow, and already thanks for looking into the performance as well :) |
davidrudlstorfer
left a comment
There was a problem hiding this comment.
Big thanks for the nice PR and also that you further looked into the performance of everything :)
Maybe it would be possible that you quickly request a review from Copilot (somehow I am not able to re-request it on this PR) and then we merge :)
|
PS: I've updated the required status checks for the PR based on your new "ensure_all_tests_pass" :) |
Relies on merging and nightly update of #135.
Changes:
requiredsection in the completion schema needed special treatment, so I adapted that.