feat(test): add integration test

!53
This commit is contained in:
2024-03-29 20:22:50 +09:30
parent 4d44c01b32
commit 220fa39734
2 changed files with 44 additions and 0 deletions

View File

@ -9,6 +9,7 @@ variables:
include:
- local: .gitlab/integration_test.gitlab-ci.yml
- project: nofusscomputing/projects/gitlab-ci
ref: development
file:

View File

@ -0,0 +1,43 @@
.integration_test:
stage: test
needs:
- "Build Collection"
# image: nofusscomputing/ansible-docker-os:$test_image
image: debian:stable
services:
- name: docker:23-dind
entrypoint: ["env", "-u", "DOCKER_HOST"]
command: ["dockerd-entrypoint.sh"]
before_script:
- | # start test container
docker run -d \
--privileged \
-v ${PWD}:/workdir \
--workdir /workdir \
--rm \
--name test_image_${CI_JOB_ID} \
nofusscomputing/ansible-docker-os:${st_image}
- | # enter test container
docker exec -ti test_image_${CI_JOB_ID} bash
- ps aux
- apt update
- apt install -y --no-install-recommends python3-pip
- pip install ansible-core
script:
- | # Install the collection
ansible-galaxy collection install /$(ls artifacts/galaxy/${ANSIBLE_GALAXY_NAMESPACE}-${ANSIBLE_GALAXY_PACKAGE_NAME}*.tar.gz)
- | # run the collection
ansible-playbook nofusscomputing.kubernetes.install;
artifacts:
untracked: true
Integration Test:
extends: .integration_test
parallel:
matrix:
- test_image: dev-debian-11
- test_image: dev-ubuntu-22.04