Skip to content

Commit

Permalink
chore: docs & verbose tests to find failure
Browse files Browse the repository at this point in the history
  • Loading branch information
puffitos committed Sep 29, 2023
1 parent a12ea9b commit a4a274a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/end2end.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ jobs:
make e2e-deploy
- name: Run End2End Tests
run: |
go mod download
make test-e2e
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ e2e-deploy:
.PHONY: test-e2e
test-e2e:
@echo "Running e2e tests..."
@go test -race -count 1 ./test/
@go test -v -race -count 1 ./test/

.PHONY: test-unit
test-unit:
@echo "Running unit tests..."
@go test -race -count 1 ./webhook/
@go test -v -race -count 1 ./webhook/

test-cleanup:
@echo "Cleaning up..."
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,29 @@ public key used to sign the image you're deploying.

# Test

Based on the signed image and the corresponding key, the demo app should appear or denied (check event log)
To test the webhook, you may run the following command(s):

```bash
kubectl create namespace cosignwebhook
kubectl -n cosignwebhook apply -f manifests/demoapp.yaml
# unit tests
make test-unit
# E2E tests
make e2e-prep
make test-e2e
```

## E2E tests

The E2E tests require a running kubernetes cluster. Currently, the namespace and webhook are deployed via helper make targets. To run the tests the following is required:

- docker
- cosign (v2)

# TODO

* [x] Support private images
* [x] Support multiple container/keys
* [ ] Support COSING_REPOSITORY

# Local build

Expand All @@ -124,6 +136,7 @@ CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o cosignw
## Credits

Frank Kloeker [email protected]
Bruno Bressi, [email protected]

Life is for sharing. If you have an issue with the code or want to improve it, feel free to open an issue or an pull
request.
Expand Down

0 comments on commit a4a274a

Please sign in to comment.