Skip to content

Commit

Permalink
use docker images to download consul binary for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ishustava committed Oct 25, 2022
1 parent 0745e1e commit 1f83c02
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:

env:
TEST_RESULTS: /tmp/test-results # path to where test results are saved
CONSUL_VERSION: 1.14.0-beta1 # Consul's OSS version to use in tests
CONSUL_ENT_VERSION: 1.14.0-beta1+ent # Consul's enterprise version to use in tests
GOTESTSUM_VERSION: 1.8.2 # You cannot use environment variables with workflows. The gotestsum version is hardcoded in the reusable workflows too.
# We use docker images to copy the consul binary for unit tests.
CONSUL_OSS_DOCKER_IMAGE: hashicorppreview/consul:1.14.0-dev # Consul's OSS version to use in tests
CONSUL_ENT_DOCKER_IMAGE: hashicorppreview/consul-enterprise:1.14.0-dev # Consul's enterprise version to use in tests

jobs:
get-go-version:
Expand Down Expand Up @@ -158,7 +159,7 @@ jobs:
working-directory: control-plane
run: |
mkdir -p $HOME/bin
container_id=$(docker create hashicorppreview/consul:1.14-dev)
container_id=$(docker create ${{env.CONSUL_OSS_DOCKER_IMAGE}})
docker cp "$container_id:/bin/consul" $HOME/bin/consul
docker rm "$container_id"
- name: Run go tests
Expand Down Expand Up @@ -205,7 +206,7 @@ jobs:
working-directory: control-plane
run: |
mkdir -p $HOME/bin
container_id=$(docker create hashicorppreview/consul-enterprise:1.14-dev)
container_id=$(docker create ${{env.CONSUL_ENT_DOCKER_IMAGE}})
docker cp "$container_id:/bin/consul" $HOME/bin/consul
docker rm "$container_id"
Expand Down

0 comments on commit 1f83c02

Please sign in to comment.