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

Move health checks to a separate function in bats test file #24

Merged
merged 2 commits into from
Apr 1, 2023

Conversation

MurzNN
Copy link
Contributor

@MurzNN MurzNN commented Mar 31, 2023

Now, regarding to the template file, we have to write checks twice:

  • In @test "install from directory"
  • And in @test "install from release" - the same lines.

Will be good to move that to a separate function, to not have two places to manage them.

So, I've created a function health_checks() that contains only a single instance of checks.

And have moved it to the top, because it will be edited more frequiently, than test functions.

Now, regarding to the template file, we have to write checks twice: 
- In `@test "install from directory"`
- And in `@test "install from release"` - the same lines.

Will be good to move that to a separate function, to not have two places to manage them. 

So, I've created a function `health_checks()` that contains only a single instance of checks.

And have moved it to the top, because it will be edited more frequiently, than test functions.
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

Great!

@rfay rfay self-requested a review March 31, 2023 16:12
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

Please run tests manually and get them to pass...

@MurzNN
Copy link
Contributor Author

MurzNN commented Apr 1, 2023

Seems bats doesn't support functions with all commented lines, so I've just added one real line there and it starts working:
image

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

Thanks! It's certainly an improvement.

@rfay rfay merged commit a8c17cd into ddev:main Apr 1, 2023
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