Skip to content

Commit

Permalink
feat(redis): fix redis bats tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alexei Dodon <[email protected]>
  • Loading branch information
adodon2go committed Jul 8, 2024
1 parent 038f95e commit f0a86d9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ecosystem-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions: read-all
jobs:
client-tools:
name: Check client tools
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ run-blackbox-cloud-ci: check-blackbox-prerequisites check-awslocal binary $(BATS
echo running cloud CI bats tests; \
$(BATS) $(BATS_FLAGS) test/blackbox/cloud_only.bats
$(BATS) $(BATS_FLAGS) test/blackbox/sync_cloud.bats
$(BATS) $(BATS_FLAGS) test/blackbox/redis_s3.bats

.PHONY: run-blackbox-dedupe-nightly
run-blackbox-dedupe-nightly: check-blackbox-prerequisites check-awslocal binary binary-minimal
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PATH=$PATH:${SCRIPTPATH}/../../hack/tools/bin

tests=("pushpull" "pushpull_authn" "delete_images" "referrers" "metadata" "anonymous_policy"
"annotations" "detect_manifest_collision" "cve" "sync" "sync_docker" "sync_replica_cluster"
"scrub" "garbage_collect" "metrics" "metrics_minimal" "multiarch_index" "redis_local" "redis_s3")
"scrub" "garbage_collect" "metrics" "metrics_minimal" "multiarch_index" "redis_local")

for test in ${tests[*]}; do
${BATS} ${BATS_FLAGS} ${SCRIPTPATH}/${test}.bats > ${test}.log & pids+=($!)
Expand Down
6 changes: 0 additions & 6 deletions test/blackbox/helpers_redis.bash
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
ROOT_DIR=$(git rev-parse --show-toplevel)
OS=$(go env GOOS)
ARCH=$(go env GOARCH)
ZOT_MINIMAL_PATH=${ROOT_DIR}/bin/zot-${OS}-${ARCH}-minimal
ZB_PATH=${ROOT_DIR}/bin/zb-${OS}-${ARCH}
TEST_DATA_DIR=${BATS_FILE_TMPDIR}/test/data

function redis_start() {
local cname="$1"
Expand Down
5 changes: 5 additions & 0 deletions test/blackbox/redis_local.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function setup_file() {
exit 1
fi

# Download test data to folder common for the entire suite, not just this file
skopeo --insecure-policy copy --format=oci docker://ghcr.io/project-zot/golang:1.20 oci:${TEST_DATA_DIR}/golang:1.20

# Setup redis server
redis_port=$(get_free_port)
redis_start redis_server_local ${redis_port}
Expand Down Expand Up @@ -99,6 +102,8 @@ EOF
@test "pull both images" {
local oci_data_dir=${BATS_FILE_TMPDIR}/oci
zot_port=`cat ${BATS_FILE_TMPDIR}/zot.port`

mkdir -p ${oci_data_dir}
run skopeo --insecure-policy copy --src-tls-verify=false \
docker://127.0.0.1:${zot_port}/golang:1.20 \
oci:${oci_data_dir}/golang:1.20
Expand Down

0 comments on commit f0a86d9

Please sign in to comment.