+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_cli): normalize the content of CLI snapshots #3835

Merged
merged 1 commit into from
Nov 25, 2022
Merged

Conversation

leops
Copy link
Contributor

@leops leops commented Nov 23, 2022

Summary

This PR is an attempt at improving the general stability of CLI snapshot tests by "redacting" some unstable elements from the snapshot content that would be susceptible to change from one run to another. This includes the path to the current executable and the temporary directory, the time it takes for the CLI to execute, and the platform-specific path separator.

Test Plan

This should solve some of the stability issues we currently have with the CI runs, but not all of them though: we still have semi-random failures on the max_diagnostics tests that can be reproduced more easily on some platforms than other.

@leops leops requested a review from ematipico as a code owner November 23, 2022 16:25
@MichaReiser MichaReiser added the A-Tooling Area: our own build, development, and release tooling label Nov 24, 2022
match $result {
Ok(res) => res,
Err(err) if option_env!("CI") == Some("1") => panic!("failed to create symlink: {err}"),
Err(_) => return,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would find it useful if the macro could write a message explaining that the test failed with the given message and then give instructions how to run that test if necessary (run as administrator)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When not running on CI the test will not fail here, it will be reported as a success instead. Ideally it would be reported as skipped but ignoring tests dynamically is not supported by the default Rust test harness. Printing a message wouldn't work either since the test framework also captures the output of tests and only prints it to the console if the test fails.

@leops leops merged commit 50e48b3 into main Nov 25, 2022
@leops leops deleted the fix/cli-snapshots branch November 25, 2022 08:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Tooling Area: our own build, development, and release tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载