Skip to content

Add pipeline to run integration test on k3d #492

@mszostok

Description

@mszostok

Description

Recently, we added support for k3d (#466). To ensure no regression, we need to create a pipeline that will run on each PR and main branch. It will be exactly the same as we have with the kind.

integration-tests:
name: Integration tests
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
needs: [ push-apps, push-tests, build-cli ]
permissions:
contents: read
env:
CAPACT_BINARY: "${{ github.workspace}}/capact-linux-amd64"
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
. ./hack/ci/setup-env.sh
- name: Download Capact CLI
uses: actions/download-artifact@v2
with:
name: cli_${{github.sha}}
path: ${{ github.workspace }}
- name: Setup Capact CLI
run: |
chmod +x $CAPACT_BINARY
$CAPACT_BINARY version
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{env.GO_VERSION}}
- name: Run K8s Controller integration tests
run: |
make test-k8s-controller
- name: Run cross-functional integration tests
env:
BUILD_IMAGES: "false"
ARTIFACTS: "output/"
DISABLE_MONITORING_INSTALLATION: "true"
run: |
make test-integration
- name: Upload artifacts
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: cluster_dump_${{github.sha}}
path: "output"
retention-days: 5 # Default 90 days
- name: Delete Capact CLI artifact
uses: geekyeggo/delete-artifact@v1
with:
name: cli_${{github.sha}}

We need to add it as a parallel step to the kind one.

AC

  • Integration test are executed on k3d cluster, if failed, pipeline should be red

  • Integration test on kind and k3d are run in parallel

  • Stretch:
    Use preloaded images for our dependencies. We should build image tarball only if something was changed in deploy/kubernetes/charts. Later, this tarball can be used by k3d.

    # Cache images
    capact alpha archive-images helm -v --version @latest --helm-repo @latest --output ./archive.tar --save-component=neo4j,ingress-nginx,argo,cert-manager,kubed
    
    # Preload images
    DISABLE_MONITORING_INSTALLATION=true K3D_IMAGES_ARCHIVE=archive.tar CLUSTER_TYPE=k3d make test-integration
    

    Not sure where this tarball should be stored, as we may run to GitHub cache limits: https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy. Maybe it will be better to push it to our GCS.

Reason

Ensure no regression. Additionally, test which environment is more stable and faster.

Metadata

Metadata

Assignees

Labels

area/ciRelates to CIenhancementNew feature or requestgood first issueGood for newcomershacktoberfestTasks which are a part of Hacktoberfest. Learn more on https://hacktoberfest.digitalocean.com/

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions