Skip to content

Commit fa9e628

Browse files
committed
E2e test suite
1 parent db7c317 commit fa9e628

File tree

3 files changed

+64
-36
lines changed

3 files changed

+64
-36
lines changed

.github/workflows/actions/kind-cluster/action.yml .github/actions/kind-cluster/action.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
name: 'Install and configure Kind cluster'
2+
description: 'Customized Kind-action'
3+
24
inputs:
35
config:
46
description: 'Kind config'
57
required: true
68
olm:
79
description: 'install olm'
810
required: true
9-
type: boolean
1011
default: 'false'
1112
keycloak:
1213
description: 'install keycloak'
1314
required: true
14-
type: boolean
1515
default: 'false'
1616
prometheus:
1717
description: 'install prometheus'
1818
required: true
19-
type: boolean
2019
default: 'false'
20+
21+
outputs:
22+
oidc_url:
23+
value: keycloak_url
24+
description: 'Keycloak OIDC url'
25+
2126
runs:
2227
using: 'composite'
2328
steps:
@@ -36,7 +41,7 @@ runs:
3641
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
3742
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=90s
3843
- name: Install prometheus
39-
if: ${{ inputs.prometheus }}
44+
if: ${{ inputs.prometheus == 'true'}}
4045
shell: bash
4146
run: |
4247
#install Prometheus
@@ -45,7 +50,7 @@ runs:
4550
kubectl wait --for=condition=Ready pods -l app.kubernetes.io/name=prometheus-operator -n default
4651
4752
- name: Install olm
48-
if: ${{ inputs.olm }}
53+
if: ${{ inputs.olm == 'true'}}
4954
shell: bash
5055
run: |
5156
#install OLM
@@ -55,7 +60,7 @@ runs:
5560
kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.25.0/olm.yaml
5661
5762
- name: Install keycloak
58-
if: ${{ inputs.keycloak }}
63+
if: ${{ inputs.keycloak == 'true'}}
5964
shell: bash
6065
run: |
6166
kubectl create --kustomize ci/keycloak/operator/overlay/kind
@@ -66,9 +71,9 @@ runs:
6671
sleep 10
6772
done
6873
kubectl create --kustomize ci/keycloak/resources/overlay/kind
69-
until [[ $( oc get keycloak keycloak -o jsonpath='{.status.ready}' -n keycloak-system 2>/dev/null) == "true" ]]
74+
until [[ $( kubectl get keycloak keycloak -o jsonpath='{.status.ready}' -n keycloak-system 2>/dev/null) == "true" ]]
7075
do
71-
printf "Waiting for keycloak deployment. \n Keycloak ready: %s\n" $(oc get keycloak keycloak -o jsonpath='{.status.ready}' -n keycloak-system)
76+
printf "Waiting for keycloak deployment. \n Keycloak ready: %s\n" $(kubectl get keycloak keycloak -o jsonpath='{.status.ready}' -n keycloak-system)
7277
sleep 10
7378
done
7479
@@ -92,4 +97,6 @@ runs:
9297
number: 80
9398
path: /
9499
pathType: Prefix
95-
EOF
100+
EOF
101+
102+
echo "keycloak_url=https://keycloak-internal.keycloak-system.svc" >> $GITHUB_OUTPUT

.github/workflows/main.yml

+45-24
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
env:
1111
GO_VERSION: 1.22
12+
OPERATOR_SDK_VERSION: v1.37.0
1213
IMG: ttl.sh/securesign/secure-sign-operator-${{github.run_number}}:1h
1314
BUNDLE_IMG: ttl.sh/securesign/bundle-secure-sign-${{github.run_number}}:1h
1415
CATALOG_IMG: ttl.sh/securesign/catalog-${{github.run_number}}:1h
@@ -205,7 +206,7 @@ jobs:
205206
run: podman load -i /tmp/operator-oci.tar
206207

207208
- name: Install Cluster
208-
uses: ./.github/workflows/actions/kind-cluster
209+
uses: ./.github/actions/kind-cluster
209210
with:
210211
config: ./ci/config.yaml
211212
prometheus: 'true'
@@ -286,7 +287,7 @@ jobs:
286287
podman load -i /tmp/catalog-oci.tar
287288
288289
- name: Install Cluster
289-
uses: ./.github/workflows/actions/kind-cluster
290+
uses: ./.github/actions/kind-cluster
290291
with:
291292
config: ./ci/config.yaml
292293
prometheus: 'true'
@@ -356,7 +357,7 @@ jobs:
356357
run: podman load -i /tmp/operator-oci.tar
357358

358359
- name: Install Cluster
359-
uses: ./.github/workflows/actions/kind-cluster
360+
uses: ./.github/actions/kind-cluster
360361
with:
361362
config: ./ci/config.yaml
362363

@@ -382,18 +383,17 @@ jobs:
382383

383384
test-e2e:
384385
name: Execute securesign/sigstore-e2e
385-
runs-on: ubuntu-20.04
386+
runs-on: ubuntu-22.04
386387
needs:
387-
- build-fbc
388+
- build-operator
388389
steps:
389-
- name: Free Disk Space (Ubuntu)
390-
uses: jlumbroso/free-disk-space@main
391-
with:
392-
tool-cache: true
393390
- name: Checkout source
394391
uses: actions/checkout@v4
392+
- name: Checkout test source repository
393+
uses: actions/checkout@v4
395394
with:
396395
repository: "securesign/sigstore-e2e"
396+
path: e2e
397397

398398
- name: Install Go
399399
uses: actions/setup-go@v5
@@ -421,35 +421,56 @@ jobs:
421421
- name: Load images
422422
run: |
423423
podman load -i /tmp/operator-oci.tar
424-
podman load -i /tmp/bundle-oci.tar
425-
podman load -i /tmp/catalog-oci.tar
426424
427425
- name: Install Cluster
428-
uses: ./.github/workflows/actions/kind-cluster
426+
id: kind
427+
uses: ./.github/actions/kind-cluster
429428
with:
430429
config: ./ci/config.yaml
431430
keycloak: 'true'
432431
olm: 'true'
432+
prometheus: 'true'
433433

434434
- name: Add service hosts to /etc/hosts
435435
run: |
436436
sudo echo "127.0.0.1 fulcio-server.local tuf.local rekor-server.local rekor-search-ui.local cli-server.local" | sudo tee -a /etc/hosts
437437
438-
- name: Install operator
439-
run:
440-
441-
- name: Run tests
438+
- name: Deploy operator container
442439
env:
443-
TEST_MANAGER_IMAGE: ${{ env.IMG }}
444440
OPENSHIFT: false
445-
run: make install && go test ./test/e2e/... -tags=custom_install -p 1 -timeout 20m
441+
run: make deploy
446442

447-
- name: Archive test artifacts
448-
uses: actions/upload-artifact@v4
449-
if: always()
450-
with:
451-
name: test-custom-install
452-
path: test/**/k8s-dump-*.tar.gz
443+
- name: Wait for operator to be ready
444+
run: |
445+
kubectl wait --for=condition=available deployment/rhtas-operator-controller-manager --timeout=120s -n openshift-rhtas-operator
446+
447+
- name: Install securesign
448+
run: |
449+
sed -i 's#https://your-oidc-issuer-url#${{ steps.kind.outputs.oidc_url }}#' config/samples/rhtas_v1alpha1_securesign.yaml
450+
sed -i 's#rhtas.redhat.com/metrics: "true"#rhtas.redhat.com/metrics: "false"#' config/samples/rhtas_v1alpha1_securesign.yaml
451+
kubectl create ns test
452+
kubectl create -f config/samples/rhtas_v1alpha1_securesign.yaml -n test
453+
sleep 1
454+
kubectl wait --for=condition=Ready securesign/securesign-sample -n test
455+
456+
- name: Run tests
457+
run: |
458+
export SIGSTORE_OIDC_ISSUER=${{ steps.kind.outputs.oidc_url }}
459+
export FULCIO_URL=$(kubectl get securesign -o jsonpath='{.items[0].status.fulcio.url}' -n test)
460+
export REKOR_URL=$(kubectl get securesign -o jsonpath='{.items[0].status.rekor.url}' -n test)
461+
export TUF_URL=$(kubectl get securesign -o jsonpath='{.items[0].status.tuf.url}' -n test)
462+
export TSA_URL=$(kubectl get securesign -o jsonpath='{.items[0].status.tsa.url}' -n test)
463+
464+
export CLI_STRATEGY=cli_server
465+
export CLI_SERVER_URL="http://cli-server.local"
466+
467+
cd e2e
468+
go test -v ./test/...
469+
470+
- name: dump the logs of the operator
471+
run: |
472+
kubectl logs -n openshift-rhtas-operator deployment/rhtas-operator-controller-manager
473+
if: failure()
453474

454475
test-eks:
455476
name: Test EKS deployment

config/samples/rhtas_v1alpha1_securesign.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
externalAccess:
1414
enabled: true
1515
monitoring:
16-
enabled: true
16+
enabled: false
1717
trillian:
1818
database:
1919
create: true
@@ -31,7 +31,7 @@ spec:
3131
organizationEmail: [email protected]
3232
commonName: fulcio.hostname
3333
monitoring:
34-
enabled: true
34+
enabled: false
3535
tuf:
3636
externalAccess:
3737
enabled: true
@@ -52,7 +52,7 @@ spec:
5252
externalAccess:
5353
enabled: true
5454
monitoring:
55-
enabled: true
55+
enabled: false
5656
ntpMonitoring:
5757
enabled: true
5858
signer:

0 commit comments

Comments
 (0)