From 9910b91a1a5a3bb380701ca672454483d215ee09 Mon Sep 17 00:00:00 2001 From: duanhongyi Date: Tue, 6 Aug 2024 10:19:19 +0800 Subject: [PATCH] chore(passport): use latest codecov cli version --- Makefile | 2 +- rootfs/Dockerfile.test | 2 ++ rootfs/bin/test-unit | 1 - rootfs/bin/upload-coverage | 6 +++++- rootfs/dev_requirements.txt | 9 +++------ 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index dc1a494..b070b54 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,6 @@ test-integration: upload-coverage: $(eval CI_ENV := $(shell curl -s https://codecov.io/env | bash)) - podman run ${CI_ENV} -v ${CURDIR}:/test -w /test/rootfs ${IMAGE}.test /test/rootfs/bin/upload-coverage + podman run ${CI_ENV} -v ${CURDIR}:/test -w /test/rootfs -e CODECOV_TOKEN=${CODECOV_TOKEN} ${IMAGE}.test /test/rootfs/bin/upload-coverage .PHONY: check-kubectl check-podman build podman-build podman-build-test deploy clean commit-hook full-clean test test-style test-unit test-functional test-integration upload-coverage diff --git a/rootfs/Dockerfile.test b/rootfs/Dockerfile.test index 2b6d7d7..3e0230f 100644 --- a/rootfs/Dockerfile.test +++ b/rootfs/Dockerfile.test @@ -12,6 +12,8 @@ COPY dev_requirements.txt ${DRYCC_HOME_DIR}/dev_requirements.txt RUN buildDeps='gcc rustc cargo libffi-dev musl-dev libldap2-dev libsasl2-dev'; \ install-packages ldap-utils mercurial ca-certificates openssl git $buildDeps \ + && curl -SsL https://cli.codecov.io/latest/$([ $(dpkg --print-architecture) == "arm64" ] && echo linux-arm64 || echo linux)/codecov -o /usr/local/bin/codecov \ + && chmod +x /usr/local/bin/codecov \ && install-stack python $PYTHON_VERSION \ && install-stack postgresql $POSTGRES_VERSION \ && install-stack gosu $GOSU_VERSION && . init-stack \ diff --git a/rootfs/bin/test-unit b/rootfs/bin/test-unit index b586069..b1f9263 100755 --- a/rootfs/bin/test-unit +++ b/rootfs/bin/test-unit @@ -15,4 +15,3 @@ gosu postgres pg_ctl -D "$PGDATA" start && ln -s /tmp/.s.PGSQL.5432 /var/run/pos creating_rsa_key python3 manage.py check coverage run manage.py test --settings=api.settings.testing --noinput api -coverage report -m diff --git a/rootfs/bin/upload-coverage b/rootfs/bin/upload-coverage index 53433f3..492452b 100755 --- a/rootfs/bin/upload-coverage +++ b/rootfs/bin/upload-coverage @@ -6,4 +6,8 @@ # fail hard and fast even on pipelines set -eou pipefail -codecov --required +coverage report -m > coverage.txt + +if [[ -n $CODECOV_TOKEN ]]; then + codecov upload-process --plugin=noop -t "$CODECOV_TOKEN" +fi diff --git a/rootfs/dev_requirements.txt b/rootfs/dev_requirements.txt index 6c42313..ca19f67 100644 --- a/rootfs/dev_requirements.txt +++ b/rootfs/dev_requirements.txt @@ -1,13 +1,10 @@ # test module # test # Run "make test-unit" for the % of code exercised during tests -coverage==7.4.4 +coverage==7.6.1 # Run "make test-style" to check python syntax and style -flake8==7.0.0 - -# code coverage report at https://codecov.io/github/drycc/passport -codecov==2.1.13 +flake8==7.1.1 # mock out python-requests, mostly k8s -requests-mock==1.11.0 +requests-mock==1.12.1