Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
atlasaction: migrate apply command #64
atlasaction: migrate apply command #64
Changes from 2 commits
077acf4
9c68a4d
21f02b6
7ec8118
1a689bd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What are all these outputs? Don’t we have a way to run atlasexec with standard Atlas output?
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 thought we were aiming for tests that use an HTTP server and check that calls were made?
Also, relying on Atlas raw error strings seem fragile to me. These error strings could easily be changed in the Atlas repository and no one would think that this affects this repository
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 test checks a local flow, cloud mode is added in one of the next PRs which will use a local HTTP server.
re the tests fragility (I prefer the Google-y term "brittle", I agree it's not iron-clad. However, there is a trade-off, not relying on any error message (only the exit code) doesn't prove the argument is passed. Relying on mocking on the other hand is less brittle, but has its own costs and risks which can be discussed.
In this case, the risk of the test breaking because of an upstream error message change is low and has no impact on the user, so I opt for the simple way even if it is not 100% textbook (In general, I try to be practical and not religious about "The Right Way™")
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.
nitpicking a bit, but also a honest question since I had an opposite comment about that in one of my PRs - the raw values here are duplicated several times, why not extract them to a const?
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 have hard rules about when to use a constant and when to reuse a value. Places where it's more obvious to use a constant are when the value is used again downstream in a comparison in which case the const doesn't only save repetition (tho the constant itself is repeated), it proves correctnes (we compare to the same third value which formally must be equal and not prone to typos).
Another thing to consider is readability. Extracting to a constant sometimes makes the code less readable because you need to jump in the file to understand what that is. In this case, I think its important because the reader can understand which directory I'm referring to. It is very likely that this test func will have many cases with different migration directories to show different use cases.