Skip to content

Commit

Permalink
Update spec test to use go.mod
Browse files Browse the repository at this point in the history
Signed-off-by: Odin Ugedal <odin@ugedal.com>
  • Loading branch information
odinuge committed Jun 18, 2019
1 parent 56583ea commit 3758951
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/integration/spec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,14 @@ function teardown() {
run git clone https://github.com/opencontainers/runtime-spec.git src/runtime-spec
[ "$status" -eq 0 ]

SPEC_COMMIT=$(grep '^github.com/opencontainers/runtime-spec' ${TESTDIR}/../../vendor.conf | cut -d ' ' -f 2)
run git -C src/runtime-spec reset --hard "${SPEC_COMMIT}"
SPEC_VERSION=$(grep 'github.com/opencontainers/runtime-spec' ${TESTDIR}/../../go.mod | cut -d ' ' -f 2)

# Will look like this when not pinned to spesific tag: "v0.0.0-20190207185410-29686dbc5559", otherwise "v1.0.0"
SPEC_COMMIT=$(cut -d "-" -f 3 <<< $SPEC_VERSION)

SPEC_REF=$([[ -z "$SPEC_COMMIT" ]] && echo $SPEC_VERSION || echo $SPEC_COMMIT)

run git -C src/runtime-spec reset --hard "${SPEC_REF}"

[ "$status" -eq 0 ]
[ -e src/runtime-spec/schema/config-schema.json ]
Expand Down

0 comments on commit 3758951

Please sign in to comment.