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

docs: explain dir and tag name conflict; #535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ondreian
Copy link

@ondreian ondreian commented Aug 9, 2021

because of this
if there is a directory with the same name as your tagged tests, your tests will exit with status code zero and not actually run the tests tagged when using the currently documented --tag <name> syntax.

@netlify
Copy link

netlify bot commented Aug 9, 2021

✔️ Deploy Preview for crystal-book ready!

🔨 Explore the source changes: 2440873

🔍 Inspect the deploy log: https://app.netlify.com/sites/crystal-book/deploys/61119e6249558000099ca752

😎 Browse the preview: https://deploy-preview-535--crystal-book.netlify.app/guides/testing

@@ -146,6 +147,9 @@ Tagging an example group (`describe` or `context`) extends to all of the contain

Multiple tags can be specified by giving an [`Enumerable`](https://crystal-lang.org/api/latest/Enumerable.html), such as [`Array`](https://crystal-lang.org/api/latest/Array.html) or [`Set`](https://crystal-lang.org/api/latest/Set.html).

Be sure to use `--tag="my-tag"` syntax when there is a directory name that matches your tag name in your project or else they will be parsed as directories instead of tag filters. For example, if you have some tests that run in a Terraform environment and you have put all of your terraform scripts in `terraform/example.tf` and have also tagged some tests as `tags: "terraform"`
Copy link
Member

Choose a reason for hiding this comment

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

I don't think "Terraform" has enough relevance here to be used without any introduction

Copy link
Author

Choose a reason for hiding this comment

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

thanks for the review.

I often find concrete examples useful in docs when dealing with corner cases, but i can definitely clean it up when I'm back from vacation.

Unless it is decided this behavior is actually a crystal bug we should fix.

@Fryguy
Copy link
Contributor

Fryguy commented Aug 13, 2021

Is there a bug opened in Crystal issues for this? It feels weird to document this when it's possible we can just fix it. I'd argue that code is "stealing" the option from the --tags option, which is a bug. The same would happen possibly with other options that take values as well.

@ondreian
Copy link
Author

ondreian commented Aug 14, 2021 via email

@straight-shoota
Copy link
Member

Yes, let's discuss this first in the Crystal repo.

Initial diagnosis: https://libera.irclog.whitequark.org/crystal-lang/2021-08-09#30646868;

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.

None yet

4 participants