Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add tests for sqllogictest prioritization#20656

Open
alamb wants to merge 1 commit intoapache:mainfrom
alamb:alamb/test_prioritization
Open

Add tests for sqllogictest prioritization#20656
alamb wants to merge 1 commit intoapache:mainfrom
alamb:alamb/test_prioritization

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Mar 2, 2026

Which issue does this PR close?

Rationale for this change

Implement suggestions from @kosiew in #20576 (comment):

Can we add a deterministic tie-breaker in sort_tests (for equal priority) using relative_path, e.g. sort_by_key(|f| (priority, f.relative_path.clone())) to keep run order stable?

This would also benefit from a small unit test covering:

prioritized files are first,
non-prioritized files keep deterministic ordering

What changes are included in this PR?

  1. Add deterministic tie breaker so tests are always run in the same order
  2. Add a test for the ordering

Note that in order to actually write these tests I needed to pull the TestFile and some related logic into its own module

Are these changes tested?

Yes by CI

I also ran the tests locally via

cargo test  --profile=ci --test sqllogictests

I also double checked sqllogictests

INCLUDE_SQLITE=true cargo test --profile release-nonlto --test sqllogictests

Are there any user-facing changes?

@alamb alamb marked this pull request as draft March 2, 2026 19:22
@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Mar 2, 2026
elapsed: Duration,
}

/// TEST PRIORITY
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I refactored all this code and other TestFile logic into a new test_file module

.filter(|f| f.is_slt_file())
.filter(|f| f.check_tpch(options))
.filter(|f| f.check_sqlite(options))
.filter(|f| !f.relative_path_starts_with(TPCH_PREFIX) || options.include_tpch)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I separate the Options out of here as they aren't logically part of the Test file

@alamb alamb force-pushed the alamb/test_prioritization branch from 53e0a60 to 31ddadc Compare March 2, 2026 19:31
@alamb alamb marked this pull request as ready for review March 2, 2026 19:31
@alamb alamb requested a review from kosiew March 2, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant