From 6d65d058875833e51bd9ff0dfe1269f520aa513a Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Mon, 30 Oct 2023 10:36:29 -0700 Subject: [PATCH] Remove dapper from testing, update DBs tested (#232) * Remove dapper from testing * Bump default k3s used for testing * Update mysql and postgres versions to test Signed-off-by: Derek Nola --- .drone.yml | 9 +++++++-- .gitignore | 3 --- Dockerfile.test | 16 ++++++++++++++++ Dockerfile.test.dapper | 16 ---------------- scripts/test-helpers | 2 +- scripts/test-run-mysql | 6 ++---- scripts/test-run-postgres | 13 ++++++------- 7 files changed, 32 insertions(+), 33 deletions(-) create mode 100644 Dockerfile.test delete mode 100644 Dockerfile.test.dapper diff --git a/.drone.yml b/.drone.yml index 3330e3f4..9b405ebc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,11 +19,16 @@ steps: path: /var/run/docker.sock - name: test - image: rancher/dapper:v0.5.0 + image: rancher/dapper:v0.6.0 commands: - - dapper -f Dockerfile.test.dapper + - docker build -t kine:test-${DRONE_COMMIT} -f Dockerfile.test . + - > + docker run -i -e ARCH -e REPO -e TAG -e DRONE_TAG -e IMAGE_NAME + -v /var/run/docker.sock:/var/run/docker.sock -v kine-cache:/go/src/github.com/k3s-io/kine/.cache + --privileged kine:test-${DRONE_COMMIT} environment: ARCH: "${DRONE_STAGE_ARCH}" + DOCKER_BUILDKIT: "1" volumes: - name: docker path: /var/run/docker.sock diff --git a/.gitignore b/.gitignore index 7b4a6149..860bfd00 100644 --- a/.gitignore +++ b/.gitignore @@ -36,9 +36,6 @@ Session.vim # cscope-related files cscope.* -# Go test binaries -*.test - # JUnit test output from ginkgo e2e tests /junit*.xml diff --git a/Dockerfile.test b/Dockerfile.test new file mode 100644 index 00000000..18e52544 --- /dev/null +++ b/Dockerfile.test @@ -0,0 +1,16 @@ +FROM golang:1.21-alpine3.17 + +ARG ARCH=amd64 + +RUN apk -U add bash ca-certificates coreutils curl docker-cli file findutils gcc git less musl-dev vim wget +RUN apk -U add py3-pip && pip install kubernetes termplotlib==v0.3.4 + +ENV KINE_SOURCE /go/src/github.com/k3s-io/kine/ +ENV HOME ${KINE_SOURCE} +WORKDIR ${KINE_SOURCE} + + +COPY . ${KINE_SOURCE} + +ENTRYPOINT ["./scripts/entry"] +CMD ["test"] diff --git a/Dockerfile.test.dapper b/Dockerfile.test.dapper deleted file mode 100644 index a1e6e676..00000000 --- a/Dockerfile.test.dapper +++ /dev/null @@ -1,16 +0,0 @@ -FROM golang:1.21-alpine3.17 AS dapper - -ARG ARCH=amd64 - -RUN apk -U add bash ca-certificates coreutils curl docker-cli file findutils gcc git less musl-dev vim wget -RUN apk -U add py3-pip && pip install kubernetes termplotlib==v0.3.4 - -ENV DAPPER_RUN_ARGS --privileged -v kine-cache:/go/src/github.com/k3s-io/kine/.cache -ENV DAPPER_ENV ARCH REPO TAG DRONE_TAG IMAGE_NAME CROSS -ENV DAPPER_SOURCE /go/src/github.com/k3s-io/kine/ -ENV DAPPER_DOCKER_SOCKET true -ENV HOME ${DAPPER_SOURCE} -WORKDIR ${DAPPER_SOURCE} - -ENTRYPOINT ["./scripts/entry"] -CMD ["test"] diff --git a/scripts/test-helpers b/scripts/test-helpers index 7e291784..fd56bd17 100755 --- a/scripts/test-helpers +++ b/scripts/test-helpers @@ -205,7 +205,7 @@ provision-server() { -p 6443:6443 \ -e K3S_DEBUG=true \ -e K3S_DATASTORE_ENDPOINT=$K3S_DATASTORE_ENDPOINT \ - ${K3S_IMAGE:-docker.io/rancher/k3s:v1.25.2-k3s1} server \ + ${K3S_IMAGE:-docker.io/rancher/k3s:v1.26.9-k3s1} server \ --disable=coredns,servicelb,traefik,local-storage,metrics-server \ --disable-agent --disable-scheduler --disable-cloud-controller --disable-kube-proxy --disable-network-policy diff --git a/scripts/test-run-mysql b/scripts/test-run-mysql index 46b394c8..f0ec2f67 100755 --- a/scripts/test-run-mysql +++ b/scripts/test-run-mysql @@ -25,11 +25,9 @@ export -f start-test VERSION_LIST="\ mysql 8.0 mysql 5.7 - mysql 5.6 + mariadb 10.11 mariadb 10.5 - mariadb 10.4 - mariadb 10.3 - mariadb 10.2" + mariadb 10.4" while read ENGINE VERSION; do LABEL=$ENGINE-$VERSION DB_PASSWORD_ENV=MYSQL_ROOT_PASSWORD DB_IMAGE=docker.io/library/$ENGINE:$VERSION run-test diff --git a/scripts/test-run-postgres b/scripts/test-run-postgres index 33fbdfee..85e131e1 100755 --- a/scripts/test-run-postgres +++ b/scripts/test-run-postgres @@ -23,14 +23,13 @@ start-test() { export -f start-test VERSION_LIST="\ - postgres 13.2 - postgres 12.6 - postgres 11.11 - postgres 10.16 - postgres 9.6 - postgres 9.5" + postgres 15.4 + postgres 14.9 + postgres 13.12 + postgres 12.16 + postgres 11.21-alpine" # A generic 11.21 image is not available while read ENGINE VERSION; do - LABEL=$ENGINE-$VERSION DB_PASSWORD_ENV=POSTGRES_PASSWORD DB_IMAGE=docker.io/library/$ENGINE:$VERSION run-test + echo "LABEL=$ENGINE-$VERSION DB_PASSWORD_ENV=POSTGRES_PASSWORD DB_IMAGE=docker.io/library/$ENGINE:$VERSION run-test" done <<< $VERSION_LIST