-
Notifications
You must be signed in to change notification settings - Fork 664
test(rome_cli): add snapshots for file system and console session #3035
Conversation
Deploying with Cloudflare Pages
|
329976e
to
0798ce8
Compare
I wonder if we could transition the CLI test suite to be fully fixture and snapshot based: each test is a directory containing an |
I really like the idea, I think this could work. But I would like to apply this proposal in another PR, because your will make a lot changes. If you're OK with the structure of the snapshots, I think we can merge 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.
I'm still a bit concerned about why the upgrade_severity
test would suddenly start hanging, but I couldn't reproduce the issue locally (I tried to run the test with and without a debugger attached but the issue never manifested). Otherwise the format of the snapshots themselves seems alright to me
if !self.messages.is_empty() { | ||
content.push_str("## Messages\n\n"); | ||
|
||
for message in &self.messages { |
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.
Nit: wrap the messages in a code block to have them rendered in a <pre>
block in markdown previews and respect the line breaks
9f7dd31
to
1813c79
Compare
1813c79
to
e2ac0c4
Compare
Summary
This PR improves the CLI tests by creating a snapshot. The snapshot will contain:
The reason why I created snapshots it's because I found myself at struggle sometimes, when I needed to test specific cases. Also, there have been few issue before where some messages where not supposed to be there, and I couldn't catch them early. The snapshots, somehow, might help the testing experience a bit.
The snapshot have been added to some existing cases, but not all of them. I had to exclude some runs because of some issue that I couldn't debug (some test stalls for some reason).
Test Plan
The CI should not fail