Skip to content
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

Added comprehensive test for determining the current project. #2945

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Dec 12, 2023

StoryDX-2360 We have a test that checks our project sourcing priorities

I also upgraded the existing unit test for this.

@mitchell-as mitchell-as requested a review from MDrakos December 12, 2023 21:17
@mitchell-as mitchell-as marked this pull request as ready for review December 12, 2023 21:17
Copy link
Member

@MDrakos MDrakos left a comment

Choose a reason for hiding this comment

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

While I think the test you've setup is great it makes more sense as an integration test. When we're setting env vars in the test because certain commands do it signals to me that the behavior should be covered by an integration test. Right now, if we were to inadvertently change the behavior of state shell this unit test wouldn't fail, whereas if this was an integration test we would catch it.

Comment on lines +761 to +764
// It considers projects in the following order:
// 1. Environment variable (e.g. `state shell` sets one)
// 2. Working directory (i.e. walk up directory tree looking for activestate.yaml)
// 3. Fall back on default project
Copy link
Member

Choose a reason for hiding this comment

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

This is great to have.

Copy link
Member

@MDrakos MDrakos left a 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! Feel free to remove the unit test if you like.

@mitchell-as mitchell-as reopened this Dec 14, 2023
@mitchell-as mitchell-as merged commit a99f200 into version/0-43-0-RC1 Dec 14, 2023
14 of 15 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-2360 branch December 14, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants