Skip to content

fix(cli): adding validation when trying to run resource that does not exist #3895

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

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

danielbdias
Copy link
Contributor

@danielbdias danielbdias commented Jun 4, 2024

This PR adds a validation on the CLI to inform the user that they tried to run a test / testsuite that doesn't exist.

Example:
image

Changes

  • Add validation on run command to check if definition files exists

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

Copy link

vercel bot commented Jun 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tracetest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 5:38pm

@xoscar
Copy link
Contributor

xoscar commented Jun 4, 2024

@danielbdias I think this would be a good candidate for creating a small video recording the new CLI behavior, what do you think?

Copy link
Contributor

@xoscar xoscar left a comment

Choose a reason for hiding this comment

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

Hey @danielbdias I left a small comment

@@ -102,3 +121,20 @@ func validRequiredGatesMsg() string {

return "valid options: " + strings.Join(opts, ", ")
}

func hasValidResourceFiles() bool {
if len(runParams.DefinitionFiles) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should an empty list be valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, in the case of the OSS test. (We can use --id for that case.)
Perhaps we should have something to validate when using run groups, too?

@danielbdias
Copy link
Contributor Author

@danielbdias I think this would be a good candidate for creating a small video recording the new CLI behavior, what do you think?

@xoscar instead of adding a video, I added a small image showing the behavior, does it make sense?

@danielbdias danielbdias merged commit ed41f9e into main Jun 10, 2024
39 checks passed
@danielbdias danielbdias deleted the fix/cli-file-not-found-behavior branch June 10, 2024 15:19
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