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

feat(*): Add test_command input and exclude release tagged tests for pull request #34

Merged

Conversation

julienloizelet
Copy link
Collaborator

The Issue

Fixes #30

How This PR Solves The Issue

  • By default, the test command launched on pull request workflow will be bats tests --filter-tags !release

With this, if the add-on test is tagged with the "release" tag, it won't be executed on pull request workflow:

# bats test_tags=release
@test "install from release" {
...
...
}
  • On other workflow ("schedule", "push", etc.), the test command will be, by default, as before : bats tests

  • If an add-on maintainer needs to pass a customized test command, there is a new available string input test_command.
    When the test_command input is not empty, it will be used to run the test.

Manual Testing Instructions

To test the final behavior, you can use my forked action and points to the last commit:

steps:
      - uses: julienloizelet/ddev-add-on-test@b6b8c765ddba5fa511c2f9284e818d7fa3230f27
      with: 
          ...

How to test

  1. Backward compatibility : Create a pull request on your add-on: If you have no "release" tagged test, all test should be run as before

  2. Exclude "release" test: Tag a test with the "release" tag. This test should not be executed on PR workflow.

  3. Customized test_command: Use the test_command input to see if your customized test command is launched.

  4. backward compatibility (hard to test: you can modify the tests.yml workflow to be triggered during a push on a testing branch that contains the new action). Ensure that the launched command, for a non pull request workflow, is as before (bats tests) and that all tests are runned.

Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

Thank you @julienloizelet, I tested it with julienloizelet/ddev-add-on-test@b6b8c765ddba5fa511c2f9284e818d7fa3230f27 on https://github.com/stasadev/ddev-redis and it works perfectly.

I only have a small suggestion.

action.yaml Outdated Show resolved Hide resolved
@rfay
Copy link
Member

rfay commented Sep 30, 2024

Awesome initiative, thanks!

@julienloizelet julienloizelet force-pushed the feat/exclude-release-tests-on-pr branch from de425cd to b9d39a4 Compare October 1, 2024 00:06
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

I checked again, everything works as it should, thank you!

@julienloizelet julienloizelet merged commit cfd43cb into ddev:main Oct 1, 2024
19 of 21 checks passed
@rfay
Copy link
Member

rfay commented Oct 2, 2024

What a great improvement, thanks!

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.

Enable test grouping and segregation so release tests aren't run on PRs
3 participants