Skip to content

Commit

Permalink
Fix Duration options, not taken by env var #135 (#134)
Browse files Browse the repository at this point in the history
* Add E2E tests also to pull requests

* Fix Duration options, not taken by env var
  • Loading branch information
p53 authored Jan 8, 2022
1 parent a0fade4 commit 403866d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ jobs:
# Verify downloaded dependencies
- name: Verify dependencies
run: go mod verify
- name: "Create k3d Cluster for E2E testing"
uses: AbsaOSS/[email protected]
with:
cluster-name: "testcluster"
args: >-
-p "8081:80@loadbalancer"
- name: "Run E2E tests"
run: |
k3d kubeconfig merge testcluster --kubeconfig-switch-context
KUBECONFIG=~/.k3d/kubeconfig-testcluster.yaml kubectl apply -f ./e2e/k8s/manifest.yml
go test -v --tags=e2e
# Run tests and generates a coverage profile
- name: Test
run: |
Expand Down
7 changes: 4 additions & 3 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ func getCommandLineOptions() []cli.Flag {
case durationType:
dv := reflect.ValueOf(defaults).Elem().FieldByName(field.Name).Int()
flags = append(flags, cli.DurationFlag{
Name: optName,
Usage: usage,
Value: time.Duration(dv),
Name: optName,
Usage: usage,
Value: time.Duration(dv),
EnvVar: envName,
})
default:
panic("unknown uint64 type in the Config struct")
Expand Down
2 changes: 2 additions & 0 deletions e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func TestMain(m *testing.M) {
os.Exit(1)
}

time.Sleep(30 * time.Second)

code := m.Run()
os.Exit(code)
}
Expand Down

0 comments on commit 403866d

Please sign in to comment.