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

test: vaidate Bats minimum required version in tests #1460

Merged
merged 1 commit into from
Jan 28, 2023

Conversation

hyperupcall
Copy link
Contributor

@hyperupcall hyperupcall commented Jan 27, 2023

Summary

According to Bats, the just-merged usage of setup_suite.bash was added in Bats 1.7. Conveniently, a bats_require_minimum_version was also added to assert the minimum Bats version.

This uses that, partially addressing #1435

The assertion must be in test_helpers.bash, because versions under 1.7 won't even automatically source setup_suite.bash, making the assertion useless

@hyperupcall hyperupcall requested a review from a team as a code owner January 27, 2023 12:49
@jthegedus
Copy link
Contributor

I did read about this, and in relation to #1435 have been thinking if we should validate min versions not just in docs but as assertions in the code itself.

This specific update would only be useful for those who aren't using asdf to manage their deps in this codebase, as our CI uses the same version of Bats as defined in .tool-versions.

Copy link
Contributor

@jthegedus jthegedus left a comment

Choose a reason for hiding this comment

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

In general, I approve this idea, though it is only useful if:

  • people are aware we are using this Bats feature (bats_require_minimum_version) when expanding our Bats API usage in tests and know to update this min version
  • people are not using asdf to manage their development tools for this repo as the version defined in .tool-versions is above this minimum

Given this is low impact I will approve and merge as a step towards #1435

@jthegedus jthegedus changed the title test: Add Bats minimum version test: vaidate Bats minimum required version in tests Jan 28, 2023
@jthegedus jthegedus merged commit 22be95e into asdf-vm:master Jan 28, 2023
@hyperupcall hyperupcall deleted the h-min-bats-version branch January 28, 2023 11:00
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