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

Make unit testing multiple working directories concurrent #220

Conversation

addyess
Copy link
Contributor

@addyess addyess commented Dec 5, 2023

Applicable spec:

Overview

Running the tests workflow from a matrix fails because the concurrency group key isn't unique and all but one of the tests is cancelled:

Rationale

I'd like to be able to run multiple unit tests in parallel from my repo like this:

name: Tests

on:
  pull_request:

jobs:
  unit-tests:
    strategy:
      matrix:
        charm: ["foo", "bar"]
    uses: canonical/operator-workflows/.github/workflows/test.yaml@main
    secrets: inherit
    with:
      self-hosted-runner:  false
      working-directory:  ./${{ matrix.charm }}/

Workflow Changes

extend the group key to differentiate by working-directory

Checklist

  • The contributing guide was applied
  • The PR is tagged with appropriate label (urgent, trivial, complex)

@addyess addyess requested a review from a team as a code owner December 5, 2023 20:27
@jdkandersson
Copy link
Contributor

Looks like a bunch of caching things failed here during the tests @weiiwang01

@weiiwang01
Copy link
Collaborator

Looks like a bunch of caching things failed here during the tests @weiiwang01

@jdkandersson Yes, I think that was caused by this pull request originating from a forked repository. I think I will just force merge this pull request as this is a very minimal change and I can already see the corresponding tests passed.

@jdkandersson
Copy link
Contributor

/canonical/self-hosted-runners/run-workflows 4abff90

@jdkandersson
Copy link
Contributor

For the record, there are a bunch of CI failures linked to access issues due to this being from a fork. We should always carefully consider what to do in these cases. The tests associated with the unit tests have passed which is what is being changed here so merging without all tests passing.

@jdkandersson jdkandersson merged commit dc2f6a1 into canonical:main Dec 6, 2023
32 of 38 checks passed
@addyess addyess deleted the issue219/concurrent-tests-on-working-directory branch December 8, 2023 19:38
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