-
Notifications
You must be signed in to change notification settings - Fork 38
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
Change placeholders to {test}
and {seq}
, stop enforcing .itf.json
extension, rename test --output
to test --out-itf
#1485
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for taking care of this! I see that a couple of integration tests are breaking because the expected files were not created on quint run
with --n-traces
. Just flagging this if you want to take a look - otherwise I'll debug this later in the week
Sure, I'll take a look :) |
Just a note on |
Hmm interesting. I think it's a good idea to use the same standard as other program. I guess you can always wrap your quint command in a shell script or something and then call parallel on that to avoid the issue? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✨
Ah good point @konnov, I did not think of that. I guess the solution @bugarela works, but it's also possible to change the @konnov What do you think, are those workarounds good enough for you? |
Well, it would kind of work, but |
I agree it's a bit more complex, but you only have to figure out the right invocation of parallel once, then you can re-use it everywhere. On the other hand, changing the variable would involve making a breaking change in the Quint CLI, since we also use That said, I empathize with the goal of building tools (Quint in this case) which work well with other pre-existing tools, as per the UNIX philosophy, so I am not sure how to weigh one against the other. What do you think, @bugarela? |
What about doing something more like what TLC does and just produce a pattern without requiring the user to specify it? It takes away the ability of the user to customize the filenames to their liking, but it makes it easier for new users, which won't have to learn how to write this parameter. So if I run
it will produce |
This actually looks nice to me. |
Agreed, that's perhaps the most user-friendly and pragmatic option 👍 |
What shall we do about
Shall we keep the |
An alternative is to change the placeholders to from
This way we get the best of both worlds, being both user-friendly and configurable. Also, how about we also change |
I think that would be absolutely amazing! It's a good thing to have the templates optionally, and using |
…ess of whether it ends with `.itf.json`
{#}
placeholder in run
commands --out-itf
option, regardless of whether it ends with .itf.json
{test}
and {seq}
, stop enforcing .itf.json
extension, rename test --output
to test --out-itf
c364762
to
9a5971f
Compare
…ded, even when not needed
5963227
to
6f28477
Compare
check.sh
Outdated
# Loop through each .qnt file and check its header | ||
for file in $qnt_files; do | ||
if [[ "$(head -n 1 "$file")" != "// -*- mode: Bluespec; -*-" ]]; then | ||
echo "File $file does not start with // -*- mode: Bluespec; -*-" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! This will be useful 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops forgot to remove this, wanted to do this in a GitHub Actions workflow. Will open a separate PR for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quint/io-cli-tests.md
Outdated
@@ -864,7 +864,7 @@ rm out-itf-example.itf.json | |||
|
|||
<!-- !test in run with n-traces itf --> | |||
``` | |||
quint run --out-itf=out-itf-example.itf.json --n-traces=3 --max-steps=5 --seed=123 ../examples/tutorials/coin.qnt | |||
quint run --out-itf='out-itf-example{seq}.itf.json' --n-traces=3 --max-steps=5 --seed=123 ../examples/tutorials/coin.qnt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need to update this? Isn't the behavior on the old version of the test still the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, forgot to revert this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quint/src/cliCommands.ts
Outdated
return args.out ? 0 : args.verbosity | ||
} | ||
|
||
const Placeholders = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it fully capitalized? I don't think we have this patter of capitalization for any values in the code (only classes and types), so it's a bit odd.
const Placeholders = { | |
const PLACEHOLDERS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quint/src/cliCommands.ts
Outdated
if (template.includes(Placeholders.seq)) { | ||
return template.replaceAll(Placeholders.seq, index.toString()) | ||
} else if (options.autoAppend && template.endsWith('.itf.json')) { | ||
// Special case for the recommended extension, to avoid adding the index in between `itf` and `json` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ok, but I guess one alternative would be to add the index right before the first .
in the file name, so it would work fine with .itf.json
without having to treat it separately, and, although it doesn't matter a lot, it would work better with arbitrary file names (foo1.bla.json
is better than foo.bla1.json
I guess).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, that's a better solution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Closes: #1484
Closes: #1137
run
,test
{}
to{test}
and from{#}
to{seq}
run
{seq}
is not specifiedtest
.itf.json
extension--output
to--out-itf
, add hidden alias for the former--out-itf
is setverify
--out-itf
option contains{test}
or{seq}
as those have no effect since Apalache only produces a single trace