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

Implement half of tests in Bats #1187

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hyperupcall
Copy link
Collaborator

@hyperupcall hyperupcall commented Nov 29, 2024

This supersedes #1170. As mentioned in the issue that the PR links to, the testing suite is being converted from Pytest to Bash, mostly due to Pytest's poor support for Bash codecov.

I changed the formatting for files in bats/ because they use a lot of heredocs for improved readability of the stdout content assertions. According to the Bash manual (emphasis mine):

If the redirection operator is <<-, then all leading tab characters are stripped from input lines and the line containing delimiter. This allows here documents within shell scripts to be indented in a natural fashion.

This adds the first half of tests just to get things started. The suite can be ran with:

bats ./tests

In another PR, I'll rewrite the other half of tests, add documentation, and eventually remove the pytest stuff.

For a more detailed explanation of functions and commands (for those not as familiar with Bats), #1170 contains very verbose details in comments

Copy link
Collaborator

@spacewander spacewander left a comment

Choose a reason for hiding this comment

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

Could we add a job in the CI to run the bats test? For now, we can run both py and shell until everything is done.

@vanpipy
Copy link
Collaborator

vanpipy commented Dec 3, 2024

Great! pls replace the ci


with the bats, that makes everything done easily.

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.

3 participants