-
Notifications
You must be signed in to change notification settings - Fork 454
feature(cram): allow overriding default alias #8887
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
feature(cram): allow overriding default alias #8887
Conversation
728a7e6 to
59b58ef
Compare
|
It would have probably been better to have an |
|
@gridbugs do you want to review this one? |
| Error: Files _build/default/foo.t and _build/default/foo.t.corrected differ. | ||
| [1] | ||
|
|
||
| Now we try setting the defualt aliases twice. This should be impossible: |
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.
| Now we try setting the defualt aliases twice. This should be impossible: | |
| Now we try setting the default aliases twice. This should be impossible: |
|
Can you please update the docs with the new field. Also it's not clear to me what it means to change the default alias for a test. It looks like you always need to specify the name of the alias in order to run the test so in what sense is it a default? From looking at the example it seems like the behaviour of this feature is that tests can be grouped together by specifying the same |
By default, the alias is set to
This property applies to all fields in the
Yeah, that could work. We could add a flag like |
Do you mean all tests defined in the same directory as the |
|
Yes. Although instead of a single alias, it's a list. With a list, we can also set the default to be the empty list and therefore remove all default aliases. |
|
Ok that makes sense. I find the naming a bit confusing because there's now a notion of a "default default" alias ( |
|
Wait, there's only one level of defaults that I can see. To recap, there's two fields:
|
|
If |
|
Okay, I see what you mean. What if the name was I suppose your idea of just having a flag Any preferences? |
|
I like the name
So what if we made it so regardless of the value of |
If you need this, we can already have this: The only thing that's missing is excluding things from |
|
It's also not possible to include a test in multiple custom aliases (ie. aliases besides |
|
Nope, it's possible. You just need multiple Will make all the tests in the directory
|
|
Ah cool. In that case I'd prefer we add a flag that excludes the tests in a directory from |
|
Okay, I'll call the flag |
59b58ef to
2271af6
Compare
|
@gridbugs updated. If this is OK, I will update the docs. |
gridbugs
left a comment
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.
Looks good to me
2271af6 to
b5a8395
Compare
|
docs are in |
doc/tests.rst
Outdated
| - ``(package <package-name>)`` - attach the tests selected by this stanza to the | ||
| specified package | ||
| - ``(runtest_alias <true|false>)`` - when set to ``false``, do not add the | ||
| tests to the ``runtest`` alias by 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.
I don't get why "by default" is there. Can you add a note that if this field is omitted then the tests will be included in the @runtest alias. Also what's the use case for (runtest_alias true)? Is there ever a time when the field should be explicitly set to true?
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 don't get why "by default" is there. Can you add a note that if this field is omitted then the tests will be included in the @runtest alias
I clarified it.
Also what's the use case for (runtest_alias true)? Is there ever a time when the field should be explicitly set to true?
Mostly to allow things like (runtest_alias %{lib-available:foo}) or blang expressions if there is ever a need.
Experience tells me that flag-like fields (e.g. no_runtest_alias) end up being annoying to use. E.g. suppose that we change the default to not add the runtest alias to cram by default in a later version of the dune language, how would the user be able to switch it back on?
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.
Makes sense. Thanks for clarifying.
Introduce a [(runtest_alias ..)] that allows to enable/disable the runtest alias for cram tests. Unlike, the existing [alias] field, we're only allowed to set the this value once. Signed-off-by: Rudi Grinberg <[email protected]> <!-- ps-id: 23568b34-517f-464d-93e2-ac2c0f05f885 -->
b5a8395 to
5a11a66
Compare
|
@Alizter feel free to use this to move melange/coq to separate CI jobs. |
CHANGES: - Introduce `$ dune ocaml doc` to open and browse documentation. (ocaml/dune#7262, fixes ocaml/dune#6831, @EmileTrotignon) - `dune cache trim` now accepts binary byte units: `KiB`, `MiB`, etc. (ocaml/dune#8618, @Alizter) - No longer force colors for OCaml 4.03 and 4.04 (ocaml/dune#8778, @rgrinberg) - Introduce new experimental odoc rules (ocaml/dune#8803, @jonjudlam) - Introduce the `runtest_alias` field to the `cram` stanza. This allows removing default `runtest` alias from tests. (@rgrinberg, ocaml/dune#8887) - Do not ignore libraries named `bigarray` when they are defined in conjunction with OCaml 5.0 (ocaml/dune#8902, fixes ocaml/dune#8901, @rgrinberg) - Dependencies in the copying sandbox are now writeable (ocaml/dune#8920, @rgrinberg) - Absent packages shouldn't prevent all rules from being loaded (ocaml/dune#8948, fixes ocaml/dune#8630, @rgrinberg) - Correctly determine the stanza of menhir modules when `(include_subdirs qualified)` is enabled (@rgrinberg, ocaml/dune#8949, fixes ocaml/dune#7610) - Display cache location in Dune log (ocaml/dune#8974, @nojb) - Re-run actions whenever `(expand_aliases_in_sandbox)` changes (ocaml/dune#8990, @rgrinberg) - Rules that only use internal dune actions (`write-file`, `echo`, etc.) can now be sandboxed. (ocaml/dune#9041, fixes ocaml/dune#8854, @rgrinberg) - Do not re-run rules when their location changes (ocaml/dune#9052, @rgrinberg) - Correctly ignore `bigarray` on recent version of OCaml (ocaml/dune#9076, @rgrinberg) - Add `test_` prefix to default test name in `dune init project` (ocaml/dune#9257, fixes ocaml/dune#9131, @9sako6) - Add `coqdoc_flags` field to `coq` field of `env` stanza allowing the setting of workspace-wide defaults for `coqdoc_flags`. (ocaml/dune#9280, fixes ocaml/dune#9139, @Alizter) - [coq rules] Be more tolerant when coqc --print-version / --config don't work properly, and fallback to a reasonable default. This fixes problems when building Coq projects with `(stdlib no)` and likely other cases. (ocaml/dune#8966, fix ocaml/dune#8958, @Alizter, reported by Lasse Blaauwbroek) - Dune will now run at a lower framerate of 15 fps rather than 60 when `INSIDE_EMACS`. (ocaml/dune#8812, @Alizter) - dune-build-info: when `version=""` is found in a `META` file, we now return `None` as a version string (ocaml/dune#9177, @emillon) - Dune can now be built and installed on Haiku (ocaml/dune#8795, fix ocaml/dune#8551, @Alizter) - Mark installed directories in `dune-package` files. This fixes `(package)` dependencies against packages that contain such directories. (ocaml/dune#8953, fixes ocaml/dune#8915, @emillon)
| and+ runtest_alias = | ||
| field_o | ||
| "runtest_alias" | ||
| (Dune_lang.Syntax.since Stanza.syntax (3, 11) >>> located bool) |
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.
this should be 3.12 since it got added in 3.12.0
Introduce a [(default_aliases ..)] that allows to set the default alias
for a cram test.
Unlike, the existing [alias] field, we're only allowed to set the
default once. If the default isn't set, it's just [runtest].
Signed-off-by: Rudi Grinberg [email protected]