Skip to content

BATS infra refactor#2031

Merged
gaelicWizard merged 23 commits intoBash-it:masterfrom
gaelicWizard:bats-cleanup
Mar 4, 2022
Merged

BATS infra refactor#2031
gaelicWizard merged 23 commits intoBash-it:masterfrom
gaelicWizard:bats-cleanup

Conversation

@gaelicWizard
Copy link
Copy Markdown
Contributor

@gaelicWizard gaelicWizard commented Jan 11, 2022

Description

  • Apply recommendations from BATS documentation to the boilerplate in the test files,
  • refactor large parts of test_helper.bash,
  • use git worktree for a fast, reliable, and predictable test environment,
  • remove dependency on test_make,
  • make working tree stand up per-file, rather than per-test, so it's much faster,
  • standardize test fixture staging,
  • don't ever access my local $HOME or local $BASH_IT,
  • update bats-core to tag v1.5.0.

I believe this closes #1821.

Motivation and Context

This is chapter 2 of my last BATS patch. This time I understand BATS slightly better!

I disabled intra-file parallelization, but this can be reverted as soon as configuration is no longer inside the repo.

This alsö should resolve the drive behind #1753, as the test environment is now separated from the live repository.

How Has This Been Tested?

Lots and lots of running test/run...

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@gaelicWizard gaelicWizard force-pushed the bats-cleanup branch 5 times, most recently from 7c897ff to df2362f Compare January 11, 2022 08:15
@gaelicWizard gaelicWizard changed the title Bats cleanup BATS infra consolidation Jan 11, 2022
@gaelicWizard gaelicWizard force-pushed the bats-cleanup branch 2 times, most recently from b86c32a to 0b03ee2 Compare January 11, 2022 23:11
@gaelicWizard gaelicWizard changed the title BATS infra consolidation BATS infra refactor Jan 11, 2022
@gaelicWizard gaelicWizard force-pushed the bats-cleanup branch 21 times, most recently from 3e58a5f to 86af804 Compare January 12, 2022 04:41
@gaelicWizard gaelicWizard force-pushed the bats-cleanup branch 2 times, most recently from 30b9782 to c44d2d5 Compare February 14, 2022 00:30
Copy link
Copy Markdown
Member

@NoahGorny NoahGorny left a comment

Choose a reason for hiding this comment

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

Hi @gaelicWizard, great changes!
Can you please remove the non bats commits from this PR?
I want to merge the bats for now, and then merge the rest

Comment thread test/plugins/base.plugin.bats Outdated
@gaelicWizard
Copy link
Copy Markdown
Contributor Author

@NoahGorny, this is built on top of #2061 and there will be conflicts if I separate, but we can deal with that then. I'll separate later today 👍

@gaelicWizard
Copy link
Copy Markdown
Contributor Author

@NoahGorny, I didn't realize #2061 was already merged! Rebased on master (with no conflicts) and ready to roll 😃

Copy link
Copy Markdown
Member

@NoahGorny NoahGorny left a comment

Choose a reason for hiding this comment

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

Let's merge this

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.

Tests loading custom files

2 participants