-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from weaveworks/integration-test
add integration tests
- Loading branch information
Showing
13 changed files
with
816 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: integration | ||
|
||
on: | ||
push: | ||
branches: [ master, dev ] | ||
pull_request: | ||
branches: [ master, dev ] | ||
|
||
jobs: | ||
integration: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
namespace: [policy-system, test-system] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Install Helm | ||
uses: azure/setup-helm@v3 | ||
- name: Install kubectl | ||
uses: azure/setup-kubectl@v3 | ||
- name: Install kind | ||
uses: helm/[email protected] | ||
with: | ||
install_only: true | ||
- name: setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.17' | ||
cache: true | ||
- name: Run tests | ||
env: | ||
NAMESPACE: ${{ matrix.namespace }} | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
run: | | ||
make build | ||
VERSION=$(cat ./version.txt) | ||
docker build -t weaveworks/policy-agent:${VERSION} . | ||
cd test/integration | ||
bash deploy.sh | ||
go test -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
test/integration/data/resources/admission_test_resources.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: orphan-deployment | ||
namespace: default | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: orphan-deployment | ||
template: | ||
metadata: | ||
labels: | ||
app: orphan-deployment | ||
spec: | ||
containers: | ||
- name: ubuntu | ||
image: ubuntu:latest | ||
command: ["sleep", "100d"] | ||
securityContext: | ||
privileged: true | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: test-deployment | ||
namespace: default | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: test-deployment | ||
template: | ||
metadata: | ||
labels: | ||
app: test-deployment | ||
spec: | ||
containers: | ||
- name: ubuntu | ||
image: ubuntu:latest | ||
command: ["sleep", "100d"] | ||
securityContext: | ||
privileged: true | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: helm-app-deployment | ||
namespace: default | ||
labels: | ||
helm.toolkit.fluxcd.io/name: helm-app | ||
helm.toolkit.fluxcd.io/namespace: flux-system | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: helm-app-deployment | ||
template: | ||
metadata: | ||
labels: | ||
app: helm-app-deployment | ||
spec: | ||
containers: | ||
- name: ubuntu | ||
image: ubuntu:latest | ||
command: ["sleep", "100d"] | ||
securityContext: | ||
privileged: true | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: kustomize-app-deployment | ||
namespace: default | ||
labels: | ||
kustomize.toolkit.fluxcd.io/name: kustomize-app | ||
kustomize.toolkit.fluxcd.io/namespace: flux-system | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: kustomize-app-deployment | ||
template: | ||
metadata: | ||
labels: | ||
app: kustomize-app-deployment | ||
spec: | ||
containers: | ||
- name: ubuntu | ||
image: ubuntu:latest | ||
command: ["sleep", "100d"] | ||
securityContext: | ||
privileged: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment-1 | ||
namespace: default | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: deployment-1 | ||
template: | ||
metadata: | ||
labels: | ||
app: deployment-1 | ||
spec: | ||
containers: | ||
- name: ubuntu | ||
image: ubuntu:latest | ||
command: ["sleep", "100d"] | ||
securityContext: | ||
privileged: true | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment-2 | ||
namespace: default | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: deployment-2 | ||
template: | ||
metadata: | ||
labels: | ||
app: deployment-2 | ||
spec: | ||
containers: | ||
- name: ubuntu | ||
image: ubuntu:latest | ||
command: ["sleep", "100d"] | ||
securityContext: | ||
privileged: true |
Oops, something went wrong.