Skip to content
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

Stable test output in logs #272

Merged
merged 2 commits into from
Mar 10, 2024
Merged

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented Mar 8, 2024

Use ListMap to represent expected test results so tests always run in the same order.

This will result the same order of failed tests in the logs which makes it much more easy to compare.

@Mingun Mingun force-pushed the stable-test-order branch 3 times, most recently from c543958 to 04b5b6a Compare March 8, 2024 10:14
@GreyCat
Copy link
Member

GreyCat commented Mar 8, 2024

I love the idea, but I would suggest a slightly different implementation. Rather than copy-pasting long formula ListMap[LanguageCompilerStatic, String] everywhere, we already have an alias:

type ResultMap = Map[LanguageCompilerStatic, String]

And it's actually exactly how all test functions are defined:

  def full(src: String, srcType: DataType, expType: DataType, expOut: ResultMap)
  def full(src: String, tp: TypeProvider, expType: DataType, expOut: ResultMap)
  def everybody(src: String, expOut: String, expType: DataType = CalcIntType)
  def everybodyExcept(src: String, commonExpOut: String, rm: ResultMap, expType: DataType = CalcIntType)

Shall we just swap that to use ListMap + then swap all the test invocations to use ResultMap instead of lengthy Map[LanguageCompilerStatic, String]?

@Mingun Mingun force-pushed the stable-test-order branch from 04b5b6a to 9f323ed Compare March 9, 2024 12:35
@Mingun Mingun force-pushed the stable-test-order branch 3 times, most recently from adb303b to 4a15dc3 Compare March 9, 2024 13:31
… the same order

This will result the same order of failed tests in the logs which makes it much more easy to compare

Co-authored-by: Petr Pučil <[email protected]>
@Mingun Mingun force-pushed the stable-test-order branch from 4a15dc3 to 1bf9af9 Compare March 9, 2024 13:35
@GreyCat
Copy link
Member

GreyCat commented Mar 10, 2024

@Mingun Any objections to merge it this way, or we're good to go?

@Mingun
Copy link
Contributor Author

Mingun commented Mar 10, 2024

I have no objections, please merge.

@generalmimon generalmimon merged commit 495037c into kaitai-io:master Mar 10, 2024
1 of 4 checks passed
@Mingun Mingun deleted the stable-test-order branch March 10, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants