Skip to content

Commit 1fe1805

Browse files
committed
Add e2e test scenario
1 parent db7c317 commit 1fe1805

File tree

2 files changed

+62
-33
lines changed

2 files changed

+62
-33
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

+46-24
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ jobs:
205205
run: podman load -i /tmp/operator-oci.tar
206206

207207
- name: Install Cluster
208-
uses: ./.github/workflows/actions/kind-cluster
208+
uses: ./.github/actions/kind-cluster
209209
with:
210210
config: ./ci/config.yaml
211211
prometheus: 'true'
@@ -286,7 +286,7 @@ jobs:
286286
podman load -i /tmp/catalog-oci.tar
287287
288288
- name: Install Cluster
289-
uses: ./.github/workflows/actions/kind-cluster
289+
uses: ./.github/actions/kind-cluster
290290
with:
291291
config: ./ci/config.yaml
292292
prometheus: 'true'
@@ -356,7 +356,7 @@ jobs:
356356
run: podman load -i /tmp/operator-oci.tar
357357

358358
- name: Install Cluster
359-
uses: ./.github/workflows/actions/kind-cluster
359+
uses: ./.github/actions/kind-cluster
360360
with:
361361
config: ./ci/config.yaml
362362

@@ -382,18 +382,19 @@ jobs:
382382

383383
test-e2e:
384384
name: Execute securesign/sigstore-e2e
385-
runs-on: ubuntu-20.04
385+
runs-on: ubuntu-24.04
386386
needs:
387-
- build-fbc
387+
- build-operator
388+
env:
389+
TEST_NAMESPACE: test
388390
steps:
389-
- name: Free Disk Space (Ubuntu)
390-
uses: jlumbroso/free-disk-space@main
391-
with:
392-
tool-cache: true
393391
- name: Checkout source
394392
uses: actions/checkout@v4
393+
- name: Checkout test source repository
394+
uses: actions/checkout@v4
395395
with:
396396
repository: "securesign/sigstore-e2e"
397+
path: e2e
397398

398399
- name: Install Go
399400
uses: actions/setup-go@v5
@@ -421,35 +422,56 @@ jobs:
421422
- name: Load images
422423
run: |
423424
podman load -i /tmp/operator-oci.tar
424-
podman load -i /tmp/bundle-oci.tar
425-
podman load -i /tmp/catalog-oci.tar
426425
427426
- name: Install Cluster
428-
uses: ./.github/workflows/actions/kind-cluster
427+
id: kind
428+
uses: ./.github/actions/kind-cluster
429429
with:
430430
config: ./ci/config.yaml
431431
keycloak: 'true'
432432
olm: 'true'
433+
prometheus: 'true'
433434

434435
- name: Add service hosts to /etc/hosts
435436
run: |
436437
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
437438
438-
- name: Install operator
439-
run:
440-
441-
- name: Run tests
439+
- name: Deploy operator container
442440
env:
443-
TEST_MANAGER_IMAGE: ${{ env.IMG }}
444441
OPENSHIFT: false
445-
run: make install && go test ./test/e2e/... -tags=custom_install -p 1 -timeout 20m
442+
run: make deploy
446443

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

454476
test-eks:
455477
name: Test EKS deployment

0 commit comments

Comments
 (0)