Skip to content

Commit

Permalink
Limit E2E test to run
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Paskal <[email protected]>
  • Loading branch information
maksim-paskal committed Oct 3, 2024
1 parent 922d375 commit 2b8c6f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
on:
workflow_dispatch:
inputs:
token:
hcloud_token:
description: 'Hetzner Cloud API token'
required: true
e2e_file_name:
description: 'Name of the e2e test file, example v1.30*'
required: false

jobs:
e2e:
Expand All @@ -17,4 +20,5 @@ jobs:
- run: ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N ""
- run: make e2e branch=${{ github.base_ref || github.ref_name }}
env:
HCLOUD_TOKEN: ${{ github.event.inputs.token }}
HCLOUD_TOKEN: ${{ github.event.inputs.hcloud_token }}
E2E_FILE_NAME: ${{ github.event.inputs.e2e_file_name }}
7 changes: 6 additions & 1 deletion e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ func Test(t *testing.T) { //nolint:funlen,paralleltest,cyclop

log.SetLevel(log.WarnLevel)

tests, err := filepath.Glob("./configs/*.yaml")
nameGlob := os.Getenv("E2E_FILE_NAME")
if nameGlob == "" {
nameGlob = "*"
}

tests, err := filepath.Glob("./configs/" + nameGlob + ".yaml")
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 2b8c6f6

Please sign in to comment.