You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify and speed up metadata query for journey tests
The journey tests need to know where the target directory is. For
robustness, we have not been assuming it is `target`, but instead
attempting to allow it to be in any location, and querying cargo
metadata to find out where it is. (Doing so has the effect of
taking care of resolving it to an absolute path, too.)
This preserves that, and continues to use `justfile` logic to find
it, but does so in a more streamlined way:
- Pass `--no-deps` to `cargo metadata`, since dependencies should
not affect the location of the target directory.
- In the `jq` command that processes `cargo metadata` output, pass
`-e`/`--exit-status` so `jq` reports a failing status if the query
fails (such as by attempting to look up a missing key, due to
`cargo metadata` having failed or otherwise not producing the
expected kind of output).
- For `jq`, express `-r` as `--raw-output (and `-e` as
`--exit-status`) so that the meaning is more readily clear.
- Extract a generalized `cargo metadata ... | jq ...` recipe with
the flags we're using on both commands. This is parameterized on
the `jq` query argument only. This is to make the code easier to
read, and also in anticipation of other uses that would also want
those flags and no others but with different query strings (such
as to extract the MSRV).
And removes checks that are now unnecessary:
- Don't do a separate check for empty `jq` output anymore, since
the goal is to check for an absent key (or totally empty input),
and `-e`/`--exit-status` takes care of that.
- Don't repeat `dbg` as a prerequisite for the journey test recipes
that rely on it, instead allowing the recipes to proceed until
they get to where they really use it (which is by interpolation),
because `--no-deps` should avoid any major delays at this point
as well as making failure unlikely (but if it does fail, that is
still checked and will still fail the recipe).
0 commit comments