Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use testlagoon #748

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,22 @@ jobs:
(steps.list-changed.outputs.changed == 'true') ||
(contains(github.event.pull_request.labels.*.name, 'needs-testing'))

- name: Run chart-testing (install changed only)
run: |
ct install --config ./default.ct.yaml --helm-extra-args "--timeout 30m"
if: ${{ !contains(github.event.pull_request.labels.*.name, 'next-release') && !contains(github.event.pull_request.labels.*.name, 'needs-testing') }}
# - name: Run chart-testing (install changed only)
# run: |
# ct install --config ./default.ct.yaml --helm-extra-args "--timeout 30m"
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'next-release') && !contains(github.event.pull_request.labels.*.name, 'needs-testing') }}

- name: Run chart-testing (install changed next-release only)
# - name: Run chart-testing (install changed next-release only)
# run: |
# yq eval-all --inplace 'select(fileIndex == 0) * select(fileIndex == 1)' ./charts/lagoon-core/ci/linter-values.yaml ./charts/lagoon-core/ci/testlagoon-main-override.yaml
# ct install --config ./default.ct.yaml --helm-extra-args "--timeout 30m"
# if: ${{ contains(github.event.pull_request.labels.*.name, 'next-release') }}

- name: Run chart-testing (install changed only)
run: |
yq eval-all --inplace 'select(fileIndex == 0) * select(fileIndex == 1)' ./charts/lagoon-core/ci/linter-values.yaml ./charts/lagoon-core/ci/testlagoon-main-override.yaml
ct install --config ./default.ct.yaml --helm-extra-args "--timeout 30m"
if: ${{ contains(github.event.pull_request.labels.*.name, 'next-release') }}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'current-release') && !contains(github.event.pull_request.labels.*.name, 'needs-testing') }}

# - name: Run chart-testing (upgrade changed next-release only)
# run: |
Expand All @@ -102,7 +108,7 @@ jobs:

- name: Run chart-testing (install all charts when required)
run: ct install --config ./default.ct.yaml --helm-extra-args "--timeout 30m" --all
if: ${{ contains(github.event.pull_request.labels.*.name, 'next-release') || contains(github.event.pull_request.labels.*.name, 'needs-testing') }}
if: ${{ contains(github.event.pull_request.labels.*.name, 'current-release') || contains(github.event.pull_request.labels.*.name, 'needs-testing') }}

linter-artifacthub:
runs-on: ubuntu-latest
Expand Down
48 changes: 32 additions & 16 deletions .github/workflows/test-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ jobs:
if: |
(steps.list-changed.outputs.changed == 'true') ||
(contains(github.event.pull_request.labels.*.name, 'needs-testing')) ||
(contains(github.event.pull_request.labels.*.name, 'next-release'))
(contains(github.event.pull_request.labels.*.name, 'next-release')) ||
(contains(github.event.pull_request.labels.*.name, 'current-release'))
run: |
docker network create kind
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '. [0].IPAM.Config[0].Subnet' | tr -d '"')
Expand All @@ -75,7 +76,8 @@ jobs:
if: |
(steps.list-changed.outputs.changed == 'true') ||
(contains(github.event.pull_request.labels.*.name, 'needs-testing')) ||
(contains(github.event.pull_request.labels.*.name, 'next-release'))
(contains(github.event.pull_request.labels.*.name, 'next-release')) ||
(contains(github.event.pull_request.labels.*.name, 'current-release'))
with:
version: v0.24.0
node_image: kindest/node:v1.30.4@sha256:976ea815844d5fa93be213437e3ff5754cd599b040946b5cca43ca45c2047114
Expand All @@ -86,7 +88,8 @@ jobs:
if: |
(steps.list-changed.outputs.changed == 'true') ||
(contains(github.event.pull_request.labels.*.name, 'needs-testing')) ||
(contains(github.event.pull_request.labels.*.name, 'next-release'))
(contains(github.event.pull_request.labels.*.name, 'next-release')) ||
(contains(github.event.pull_request.labels.*.name, 'current-release'))
run: |
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '. [0].IPAM.Config[0].Subnet' | tr -d '"')
NODE_IP=$(echo ${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $1,$2,$3,240}' OFS='.')
Expand All @@ -97,7 +100,8 @@ jobs:
if: |
(steps.list-changed.outputs.changed == 'true') ||
(contains(github.event.pull_request.labels.*.name, 'needs-testing')) ||
(contains(github.event.pull_request.labels.*.name, 'next-release'))
(contains(github.event.pull_request.labels.*.name, 'next-release')) ||
(contains(github.event.pull_request.labels.*.name, 'current-release'))
run: |
helm repo add harbor https://helm.goharbor.io
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
Expand All @@ -114,7 +118,8 @@ jobs:
if: |
(steps.list-changed.outputs.changed == 'true') ||
(contains(github.event.pull_request.labels.*.name, 'needs-testing')) ||
(contains(github.event.pull_request.labels.*.name, 'next-release'))
(contains(github.event.pull_request.labels.*.name, 'next-release')) ||
(contains(github.event.pull_request.labels.*.name, 'current-release'))
run: |
cd /tmp
curl -sSLO https://github.com/itchyny/gojq/releases/download/v0.12.16/gojq_v0.12.16_linux_amd64.tar.gz
Expand All @@ -129,18 +134,27 @@ jobs:
sudo cp /tmp/kubens /usr/local/bin/kubens
sudo ln -s $(which kubectl) /usr/local/bin/kc

# - name: Helm-install the test fixtures and fill lagoon-test/ci/linter-values.yaml (needs-testing)
# if: |
# (steps.list-changed.outputs.changed == 'true' && !contains(github.event.pull_request.labels.*.name, 'next-release')) ||
# (contains(github.event.pull_request.labels.*.name, 'needs-testing'))
# run: |
# make install-lagoon
# make -j8 -O fill-test-ci-values TESTS=[${{ matrix.test }}]

# - name: Helm-install the test fixtures and fill lagoon-test/ci/linter-values.yaml (next-release)
# if: |
# (steps.list-changed.outputs.changed == 'true') &&
# (contains(github.event.pull_request.labels.*.name, 'next-release'))
# run: |
# yq eval-all --inplace 'select(fileIndex == 0) * select(fileIndex == 1)' ./charts/lagoon-core/ci/linter-values.yaml ./charts/lagoon-core/ci/testlagoon-main-override.yaml
# make install-lagoon IMAGE_REGISTRY=testlagoon IMAGE_TAG=main OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=uselagoon/build-deploy-image:main OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=testlagoon/task-activestandby:main
# make -j8 -O fill-test-ci-values TESTS=[${{ matrix.test }}] IMAGE_REGISTRY=testlagoon IMAGE_TAG=main OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=uselagoon/build-deploy-image:main OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=testlagoon/task-activestandby:main

- name: Helm-install the test fixtures and fill lagoon-test/ci/linter-values.yaml (needs-testing)
if: |
(steps.list-changed.outputs.changed == 'true' && !contains(github.event.pull_request.labels.*.name, 'next-release')) ||
(steps.list-changed.outputs.changed == 'true' && !contains(github.event.pull_request.labels.*.name, 'current-release')) ||
(contains(github.event.pull_request.labels.*.name, 'needs-testing'))
run: |
make install-lagoon
make -j8 -O fill-test-ci-values TESTS=[${{ matrix.test }}]

- name: Helm-install the test fixtures and fill lagoon-test/ci/linter-values.yaml (next-release)
if: |
(steps.list-changed.outputs.changed == 'true') &&
(contains(github.event.pull_request.labels.*.name, 'next-release'))
run: |
yq eval-all --inplace 'select(fileIndex == 0) * select(fileIndex == 1)' ./charts/lagoon-core/ci/linter-values.yaml ./charts/lagoon-core/ci/testlagoon-main-override.yaml
make install-lagoon IMAGE_REGISTRY=testlagoon IMAGE_TAG=main OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=uselagoon/build-deploy-image:main OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=testlagoon/task-activestandby:main
Expand All @@ -150,14 +164,16 @@ jobs:
if: |
(steps.list-changed.outputs.changed == 'true') ||
(contains(github.event.pull_request.labels.*.name, 'needs-testing')) ||
(contains(github.event.pull_request.labels.*.name, 'next-release'))
(contains(github.event.pull_request.labels.*.name, 'next-release')) ||
(contains(github.event.pull_request.labels.*.name, 'current-release'))
run: docker system prune -f -a --volumes

- name: Run chart-testing (install) on lagoon-test
if: |
(steps.list-changed.outputs.changed == 'true') ||
(contains(github.event.pull_request.labels.*.name, 'needs-testing')) ||
(contains(github.event.pull_request.labels.*.name, 'next-release'))
(contains(github.event.pull_request.labels.*.name, 'next-release')) ||
(contains(github.event.pull_request.labels.*.name, 'current-release'))
run: |
ct lint --config ./test-suite-run.ct.yaml
ct install --config ./test-suite-run.ct.yaml --helm-extra-args "--timeout 60m"
Expand Down
Loading