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

Allow to set the version of the unittest plugin #14

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

camalot
Copy link
Contributor

@camalot camalot commented Sep 18, 2023

accept input for unittest-version

if not set, it will use the default "latest" version.
if it is set, specify that version during the install of the plugin

@d3adb5
Copy link
Owner

d3adb5 commented Sep 19, 2023

Thank you for working on this, @camalot! Could you add a test case in the CI workflow for this, however? I understand there is incompatibility between versions 0.2.x and 0.3.x of helm-unittest, but maybe as a test case we could try installing 0.3.3 and checking that that is the version that was installed?

I'm thinking we could always let the action itself fail, as is done in existing test scenarios, and just check the version afterwards. What do you think?

@camalot
Copy link
Contributor Author

camalot commented Sep 19, 2023

Sure thing. I will look into that. I had to throw a quick fix together today as a lot of our repos started failing the other day, and i just tracked it down today to being the most recent build of helm-unittest (related issue: helm-unittest/helm-unittest#219)

we have been using this action up until when v0.3.5 was released without issue.

I will probably have some time tomorrow to take a look at adding tests around it.

@camalot
Copy link
Contributor Author

camalot commented Sep 19, 2023

ok, so i had a few minutes...

here is what I was thinking after looking at the existing test cases.

  test-action-unittest-version:
    name: Unittest Version
    runs-on: ubuntu-latest
    timeout-minutes: 10

    steps:
      - name: Checkout repository files
        uses: actions/checkout@v3
      - name: Run composite action
        uses: ./
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          unittest-version: v0.3.4
          
      - name: Check that helm-unittest is installed
        run: helm plugin list | sed 1d | awk '{print $1}' | grep -q '^unittest$'

      - name: Check that helm-unittest version is v0.3.4
        run: helm plugin list | sed 1d | awk '{print $2}' | grep -q '^v0.3.4$'

verify that it is installed, and the specified version is installed.

@d3adb5
Copy link
Owner

d3adb5 commented Sep 19, 2023

That looks good to me, feel free to commit it. If it doesn't run automatically, I'll approve the workflow here so we can see how it behaves. Thanks, @camalot!

@d3adb5
Copy link
Owner

d3adb5 commented Sep 19, 2023

Ah, Helm doesn't prefix versions in the plugin table with v, that's why it failed. The fix is simple, luckily.

@camalot
Copy link
Contributor Author

camalot commented Sep 19, 2023

yeah, i also tweaked it to include the name of the plugin, just in case. didnt want to have it "pass" if there was some other plugin that had the version.

Copy link
Owner

@d3adb5 d3adb5 left a comment

Choose a reason for hiding this comment

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

Left two suggestions, but otherwise looks good to me! Would you be so kind as to squash your commits and follow conventional commits, @camalot?

.github/workflows/ci.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
@camalot
Copy link
Contributor Author

camalot commented Sep 19, 2023

I think i squashed correctly. its been awhile.

and I think the commit message follows the Conventional Commits.

@camalot
Copy link
Contributor Author

camalot commented Sep 19, 2023

I should probably update the readme as well...

I will get to that tomorrow.

@d3adb5
Copy link
Owner

d3adb5 commented Sep 19, 2023

I took the liberty of updating the README and removing trailing whitespace. Thank you, @camalot! I'm merging this for now and creating a new release.

camalot and others added 3 commits September 18, 2023 22:54
Add an action input to set the version of helm-unittest to use. This is
particularly useful in times of instability and breaking changes.
Add information about the unittest-version action input to the project's
README file.
Remove trailing whitespace and extra empty lines from the action file.
@d3adb5 d3adb5 merged commit 82e7919 into d3adb5:master Sep 19, 2023
7 checks passed
@d3adb5 d3adb5 mentioned this pull request Sep 19, 2023
@camalot camalot deleted the v2.3-beta branch September 21, 2023 02:20
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