Skip to content

Conversation

@ratmice
Copy link
Collaborator

@ratmice ratmice commented Oct 20, 2025

Here is a first working attempt at adding array values to the grmtools section, and migrating the test_files to using that.

I also did some manual testing, e.g. that adding "*.bad_input" to the calc_input.test causes a testsuite failure.

@ltratt
Copy link
Member

ltratt commented Oct 20, 2025

My only minor overall comment is that none of the tests -- I think! -- use more than 1 element in the array?

@ratmice
Copy link
Collaborator Author

ratmice commented Oct 20, 2025

The two in 60df6f9 calc_input and ctfails/calc_bad_input both use multiple values. In the first one, i added the same glob twice.
In the second one, it parses both the good inputs from calc_input and the .bad_input files.

But actually now that I think about it this latter case is probably unreliable because of multi-threaded test runners and the globbing may be spuriously matching an empty set of files.

These should really only be matching files within the .test

@ltratt
Copy link
Member

ltratt commented Oct 20, 2025

I think the "same glob" twice probably isn't worth it (and I'd probably remove it to avoid confusing later readers): buggy code could just "accidentally" reuse the first glob, and the outcome would be the same. The second case seems sensible, although maybe we can make it rely on some set of files that we know will exist? But that might be hard.

@ratmice
Copy link
Collaborator Author

ratmice commented Oct 20, 2025

I'll add some more files to the extra_files dict, using a different extension, and glob those, should be easy.

@ltratt
Copy link
Member

ltratt commented Oct 20, 2025

Good idea!

@ltratt
Copy link
Member

ltratt commented Oct 20, 2025

I think this is ready to squash; and then we're ready to make a release?

@ratmice
Copy link
Collaborator Author

ratmice commented Oct 20, 2025

I think so too, I'll squash it in the morning after having another look over it, in case I can think of anything else and also because I'm likely too tired to squash it without making a mess of everything.

Edit: I should probably do another PR going over any clippy lints that may have crept in

@ratmice
Copy link
Collaborator Author

ratmice commented Oct 21, 2025

The only thing that came to mind over night was the behavior when a glob matches zero files,
currently we allow this and treat it as success. We could also complain though, and that would catch
cases where you have a typo in the glob, say test_files: ["*.fo"] when you have inputs input1.foo.

I could probably argue for either, but changing it for typo resistance seems worth considering.

@ltratt
Copy link
Member

ltratt commented Oct 21, 2025

Good point! Experience suggests to me that it's better if we error if there are no matches.

@ratmice
Copy link
Collaborator Author

ratmice commented Oct 21, 2025

I added that in e91fa58 it turns out that nimbleparse was already working that way,
so now CTLexerBuilder and nimbleparse match behavior.

@ltratt
Copy link
Member

ltratt commented Oct 21, 2025

Please squash.

1. Split up the current `parse_value` function into `parse_key_value`,
   and `parse_setting` functions.
2. Add support for arrays to `parse_setting`.
3. Switch the top-level `test_files` support to expect an array.
@ratmice ratmice force-pushed the grmtools_section_array_values branch from 89a2aa7 to 57717e3 Compare October 21, 2025 22:20
@ratmice
Copy link
Collaborator Author

ratmice commented Oct 21, 2025

Squashed

@ratmice ratmice mentioned this pull request Oct 22, 2025
@ltratt ltratt added this pull request to the merge queue Oct 22, 2025
Merged via the queue into softdevteam:master with commit 9a78f2f Oct 22, 2025
2 checks passed
@ratmice ratmice deleted the grmtools_section_array_values branch October 22, 2025 15:22
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.

2 participants