Skip to content

feat(test): Changed testing system to allow more granular checks#1876

Open
Shikhar-Srivastava-16 wants to merge 38 commits into
mainfrom
feat/new-testing-harness
Open

feat(test): Changed testing system to allow more granular checks#1876
Shikhar-Srivastava-16 wants to merge 38 commits into
mainfrom
feat/new-testing-harness

Conversation

@Shikhar-Srivastava-16

@Shikhar-Srivastava-16 Shikhar-Srivastava-16 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Changed the testing system to generate a different test for each runcase for each essence file

Related issues

resolve #1475 (changed to 1880 and other PRs)
related to #1822 (vaguely)

Key changes

  • Moved runcase into test_config module
  • changed integration test to only run a single runcase per test
  • changed cleanup to only delete files for a single runcase
  • changed build.rs to enumerate over runcases instead of enumerating in integration_test()
  • Moved AcceptMode to the golden_files. This is because AcceptMode becomes a dependecy of the build script due to the next change
  • The assertion to avoid extra golden files is now done before tests are run via the build script

How to test/review

Use cargo test integration
Use cargo test integration sat-direct -- This could not be done before and is a new way of only running the tests that use a specific solver config

@conjure-bot

conjure-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

Automatically assigned this pull request to @Shikhar-Srivastava-16.

If it makes more sense for someone else to own it, feel free to reassign it.

@Shikhar-Srivastava-16
Shikhar-Srivastava-16 marked this pull request as draft June 12, 2026 07:30
@conjure-bot

conjure-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

Code Coverage

Report: https://conjure-cp.github.io/conjure-oxide-reports/pr/1876/coverage-code/index.html
Diff report: https://conjure-cp.github.io/conjure-oxide-reports/pr/1876/coverage-code/diff-coverage.html

This PR: 72.91% lines (22689/31121)
Diff: 55.00% lines (101/183 measured; 11709 changed)
Main: 73.35% lines (22696/30943)
Delta vs main: -0.44 pp

@conjure-bot

conjure-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

RustDoc Coverage

Report: https://conjure-cp.github.io/conjure-oxide-reports/pr/1876/coverage-docs/index.html

This PR: 44.29% documented, 2.85% with examples (37/574/1296)
Main: 44.25% documented, 2.86% with examples (37/573/1295)
Delta: docs +0.04 pp, examples -0.00 pp

@Shikhar-Srivastava-16

Copy link
Copy Markdown
Contributor Author

This PR is too big for Vale to parse.

@Shikhar-Srivastava-16

Copy link
Copy Markdown
Contributor Author

@ozgurakgun this is the PR I was talking about, please take a look and let me known if you think this is a good idea

can also cherry-pick the name change if you would rather not wait for this PR

@ozgurakgun

Copy link
Copy Markdown
Contributor

@ozgurakgun this is the PR I was talking about, please take a look and let me known if you think this is a good idea

can also cherry-pick the name change if you would rather not wait for this PR

sorry I don't remember the conversation - can you give me some hints? :)

@Shikhar-Srivastava-16

Shikhar-Srivastava-16 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@ozgurakgun this is the PR I was talking about, please take a look and let me known if you think this is a good idea
can also cherry-pick the name change if you would rather not wait for this PR

sorry I don't remember the conversation - can you give me some hints? :)

Sorry, should have made it clearer - the PR I was talking about in my comment on your issue (#1475). Long story short, it renames the tests-integration directory and I wanted you to be aware so you don't also do it

Comment thread docs/src/developers-guide/testing/index.md
Comment thread test-suite/src/test_config.rs Outdated
Comment thread test-suite/build.rs
Comment thread test-suite/build.rs Outdated
@ozgurakgun

Copy link
Copy Markdown
Contributor

Got it! In fact I think I'll make a PR that just renames that directory and nothing else. You can rebase this on top of that I guess.

I think I'll call it test-suite instead of testing.

@ozgurakgun

Copy link
Copy Markdown
Contributor

there are a million changes in the test files, so this will take a while to review properly. but in the meantime I noticed a bunch of *generated* files being committed bu mistake. can you remove these please?

ozgurakgun added a commit that referenced this pull request Jun 15, 2026

@ozgurakgun ozgurakgun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Remove generated files
  • There are conflict markers in some of the files. Search for <<<<
  • The golden test files get renamed for now reason. We append the solver name in two places.
  • assert_no_redundant_expected_files is removed, we should keep that
  • setup_integration_tests uses HashSet which is redundant

@Shikhar-Srivastava-16

Shikhar-Srivastava-16 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author
  • Remove generated files

    • There are conflict markers in some of the files. Search for <<<<

    • The golden test files get renamed for now reason. We append the solver name in two places.

    • assert_no_redundant_expected_files is removed, we should keep that

    • setup_integration_tests uses HashSet which is redundant

@ozgurakgun thank you for pointing this out. I will make all of the other changes, but I am not sure how the golden test files work, could you please let me know what changes I should make other than adding back the assert_no_redundant_expected_files function call?

Additionally, the most recent commits have some sort of issue with Minion, and I have no idea what is wrong with that, could you please help out with that?

@Shikhar-Srivastava-16

Copy link
Copy Markdown
Contributor Author
  • Remove generated files

    • There are conflict markers in some of the files. Search for <<<<
    • The golden test files get renamed for now reason. We append the solver name in two places.
    • assert_no_redundant_expected_files is removed, we should keep that
    • setup_integration_tests uses HashSet which is redundant

@ozgurakgun thank you for pointing this out. I will make all of the other changes, but I am not sure how the golden test files work, could you please let me know what changes I should make other than adding back the assert_no_redundant_expected_files function call?

Additionally, the most recent commits have some sort of issue with Minion, and I have no idea what is wrong with that, could you please help out with that?

As a follow up on this previous message, I have made all necessary changes other than checking for redundant golden files. The problem is that currently, we check for all files with the .expected or -expected format, which means that with the new system that I introduce in this PR, this check will always fail if performed as-is.

Each test (which pertains to a single runcase) will find golden files for all other runcases on the same file in its 'parent' directory, and therefore fail.

There are a few ways to quickly fix this. The first is to perform, with each test, a check for golden files for all runcases, which leads to massive redundancy. The second is to only check for files of a certain runcase, which may miss some redundant (or irrelevant) files. The third is to do this check in build.rs before enumerating over the runcases. This will fix both the problem at the cost of forcing the user to fix these problems before allowing them to even run tests.

@ozgurakgun please let me know what you think. I am leaning towards the third option.

@ozgurakgun

Copy link
Copy Markdown
Contributor

Sorry, I am slow to respond to this one, but I have been focusing on #1893, where I change quite a bit about the integration tester as well.

@Shikhar-Srivastava-16

Shikhar-Srivastava-16 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@ozgurakgun When you next review this PR, please be careful because there are a bunch of changes to the roundtrip tests. This is not due to anything I have changed. I believe it is because I improperly rebased after another PR was merged.

Please also keep in mind that I have edited the description to have a few new changes.

@ozgurakgun

Copy link
Copy Markdown
Contributor

Thanks @Shikhar-Srivastava-16

I'll get to this once #1893 lands and that is waiting for Georgii's representation changes to land...

I have a feeling @gskorokhod will be busy with graduation this week :)

So this might take a while.

@Shikhar-Srivastava-16

Copy link
Copy Markdown
Contributor Author

Thanks @Shikhar-Srivastava-16

I'll get to this once #1893 lands and that is waiting for Georgii's representation changes to land...

I have a feeling @gskorokhod will be busy with graduation this week :)

So this might take a while.

Thank you for letting me know. I do think that this PR might make your life easier for #1893 in particular, as one of the things you're having to do (according to the description) is disabling backends to test one solver at a time. One of the features this PR adds is the ability to just run all tests for a single solver, which might save you some work.

Additionally, the main reason I made this PR (and why I've been pushing this change harder than usual) is because I wanted to be able to run tests with this granularity so that I could more easily adapt the SAT code to the new representation system.

Ultimately, of course, it is up to, but I thought that this information might be relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename tests-integration to testing

2 participants