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

Extend bricks to test calculation #527

Merged
merged 7 commits into from
Jan 12, 2025

Conversation

imrekoszo
Copy link
Contributor

@imrekoszo imrekoszo commented Jan 10, 2025

Adds a new key to project (bricks-to-test-all-sources) which differs from bricks-to-test in that it might contain bricks that don't have any dedicated test sources.

This is to let test runners discover potential tests in src-only bricks as well. (Like Kaocha's automatic spec test generation)

TODO:

  • find a better name for the new key
  • update docs

Also see #448

Copy link
Collaborator

@tengstrand tengstrand left a comment

Choose a reason for hiding this comment

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

I made a couple of comments, but except from that, I like your changes!

#{})]
included-bricks (common/brick-names-to-test test eligible-bricks)
user-selected-bricks (if user-selected-bricks (set user-selected-bricks) eligible-bricks)
selected-bricks (if include-project
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the user doesn't add brick:foo or project:bar this function (bricks-to-test) will return (directly or indirectly) changed bricks, which we want to test. I think it's a bit misleading to change from changed-bricks to selected-bricks here, for that reason.

I understand why you did the other change from selected-bricks to user-selected-bricks. But I would prefer to keep the name selected-bricks. The reason is that it's called that everywhere else in the call chain. We also have selected-projects. I think that can keep its name too, otherwise we should rename that to user-selected-projects too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I renamed them back.

(bricks-for-source project %))))
(vec))
;; might include bricks that don't have test sources
:bricks-to-test-2
Copy link
Collaborator

Choose a reason for hiding this comment

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

And yes, we need to come up with a better name. One suggestion is :bricks-to-test-all-sources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like it, thanks!

Copy link
Collaborator

@tengstrand tengstrand left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@tengstrand tengstrand merged commit 345af49 into polyfy:master Jan 12, 2025
3 checks passed
@imrekoszo imrekoszo deleted the extend-bricks-to-test branch January 13, 2025 15:48
@imrekoszo
Copy link
Contributor Author

Thank you!

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