Skip to content

Commit

Permalink
smoke: fix stable version for compatibility test
Browse files Browse the repository at this point in the history
And let's make stable version name as a env.

Signed-off-by: Yan Song <[email protected]>
  • Loading branch information
imeoer committed Nov 2, 2023
1 parent 75c87e9 commit 6bb7d6e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ env:
CARGO_TERM_COLOR: always
IMAGE: wordpress
TAG: 6.1.1
NYDUS_STABLE_VERSION: v2.2.3
NYDUS_STABLE_VERSION_EXPORT: v2_2_3

jobs:
contrib-build:
Expand Down Expand Up @@ -149,8 +151,8 @@ jobs:
- name: Prepare Older Binaries
id: prepare-binaries
run: |
versions=(v0.1.0 v2.2.3)
version_archs=(v0.1.0-x86_64 v2.2.3-linux-amd64)
versions=(v0.1.0 ${{env.NYDUS_STABLE_VERSION}})
version_archs=(v0.1.0-x86_64 ${{env.NYDUS_STABLE_VERSION}}-linux-amd64)
for i in ${!versions[@]}; do
version=${versions[$i]}
version_arch=${version_archs[$i]}
Expand All @@ -175,8 +177,8 @@ jobs:
sudo install -D -m 755 contrib/nydusify/cmd/nydusify /usr/bin/nydus-latest
sudo install -D -m 755 target/release/nydusd target/release/nydus-image /usr/bin/nydus-latest
versions=(v0.1.0 v2.2.3 latest)
version_exports=(v0_1_0 v2_2_3 latest)
versions=(v0.1.0 ${{env.NYDUS_STABLE_VERSION}} latest)
version_exports=(v0_1_0 ${{env.NYDUS_STABLE_VERSION_EXPORT}} latest)
for i in ${!version_exports[@]}; do
version=${versions[$i]}
version_export=${version_exports[$i]}
Expand Down
8 changes: 5 additions & 3 deletions smoke/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ test: build
sudo -E ./smoke.test -test.v -test.timeout 10m -test.parallel=16 -test.run=$(TESTS)

# WORK_DIR=/tmp \
# NYDUS_STABLE_VERSION=v2.2.3 \
# NYDUS_STABLE_VERSION_EXPORT=v2_2_3 \
# NYDUS_BUILDER=/path/to/latest/nydus-image \
# NYDUS_NYDUSD=/path/to/latest/nydusd \
# NYDUS_NYDUSIFY=/path/to/latest/nydusify \
# NYDUS_BUILDER_v0_1_0=/path/to/v0.1.0/nydus-image \
# NYDUS_NYDUSD_v0_1_0=/path/to/v0.1.0/nydusd \
# NYDUS_NYDUSIFY_v0_1_0=/path/to/v0.1.0/nydusify \
# NYDUS_BUILDER_v2_1_4=/path/to/v2.1.4/nydus-image \
# NYDUS_NYDUSD_v2_1_4=/path/to/v2.1.4/nydusd \
# NYDUS_NYDUSIFY_v2_1_4=/path/to/v2.1.4/nydusify \
# NYDUS_BUILDER_$NYDUS_STABLE_VERSION_EXPORT=/path/to/$NYDUS_STABLE_VERSION/nydus-image \
# NYDUS_NYDUSD_$NYDUS_STABLE_VERSION_EXPORT=/path/to/$NYDUS_STABLE_VERSION/nydusd \
# NYDUS_NYDUSIFY_$NYDUS_STABLE_VERSION_EXPORT=/path/to/$NYDUS_STABLE_VERSION/nydusify \
# make test TESTS=TestCompatibility
test-compatibility: build
make test TESTS=TestCompatibility
10 changes: 7 additions & 3 deletions smoke/tests/compatibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
package tests

import (
"os"
"testing"

"github.com/dragonflyoss/image-service/smoke/tests/tool"
"github.com/dragonflyoss/image-service/smoke/tests/tool/test"
"github.com/stretchr/testify/require"
)

const (
Expand All @@ -24,14 +26,16 @@ type CompatibilityTestSuite struct {
}

func (c *CompatibilityTestSuite) TestConvertImages() test.Generator {
stableVersion := os.Getenv("NYDUS_STABLE_VERSION")
require.NotEmpty(c.t, stableVersion, "please specify env `NYDUS_STABLE_VERSION` to run the compatibility test.")

scenarios := tool.DescartesIterator{}
scenarios.
Dimension(paramImage, []interface{}{"nginx:latest"}).
Dimension(paramFSVersion, []interface{}{"5", "6"}).
Dimension(paramNydusImageVersion, []interface{}{"v0.1.0", "v2.1.6", "latest"}).
Dimension(paramNydusifyVersion, []interface{}{"v0.1.0", "v2.1.6", "latest"}).
Dimension(paramNydusdVersion, []interface{}{"v0.1.0", "v2.1.6", "latest"}).
Dimension(paramNydusImageVersion, []interface{}{"v0.1.0", stableVersion, "latest"}).
Dimension(paramNydusifyVersion, []interface{}{"v0.1.0", stableVersion, "latest"}).
Dimension(paramNydusdVersion, []interface{}{"v0.1.0", stableVersion, "latest"}).
Skip(func(param *tool.DescartesItem) bool {

// Nydus-image 0.1.0 only works with nydus-nydusify 0.1.0, vice versa.
Expand Down

0 comments on commit 6bb7d6e

Please sign in to comment.