-
Notifications
You must be signed in to change notification settings - Fork 428
feat(txtar): txtar file options & formating #4494
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
base: master
Are you sure you want to change the base?
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Can we use direct commands instead of comments, perhaps something like "setop opt=foo"? |
Those options are test-level instructions that impact this integration test only, and they need to be interpreted and parsed ahead of time, before running and setting up That said, it's not the case for all the instructions; it only matters for |
I'm also more in favor of putting the options inside of a command; this would have to be parsed beforehand, as you mentioned @gfanton, but I think it's better if the "directive" is considered as part of the code rather than being a special comment. |
Alright, you guys win, I will implement the |
e48ea56
to
99dca94
Compare
I initially aimed to resolve timeout issue caused by a potential process leak when a node was not ready, which led to test failures. The process could persist because it was not terminated.
I've ended adding a way to customize the test runtime on a file-by-file basis using flag options with
# txtar:opts <flags>
at the beginning of the file.e.g with

gc.txtar
file:You can find more infos in
doc.go
within integration folder.This feature also enables an easy and convenient way to integrate more options in the future at either the file or test level.
Note
-no-parallel
flag override previous implementation by doing it natively usingt.Parallel
instead of mutex locking.-timeout
can be set either at file flags level (global file timeout), or at node level usinggnoland start -timeout=x
Formatting
I also added a way to format
gno
files withintxtar
. You can use it withgo test -ts-fmt
(files using-no-fmt
option will not be formated). This formatting is not yet enforced in the CI, as it can be somewhat inconvenient to run. It requires a test to be fully complete and the package to be loaded in memory to resolve and format the file. While it should be possible to enforce this, I will add it to the CI later.this PR include formatting on some
txtar
files