Browse Source

e2e tests in CI

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 5 months ago
parent
commit
26e46d7cc8
3 changed files with 21 additions and 6 deletions
  1. 6 0
      .github/workflows/ci.yml
  2. 15 5
      pkg/e2e/framework.go
  3. 0 1
      pkg/e2e/model_test.go

+ 6 - 0
.github/workflows/ci.yml

@@ -183,6 +183,12 @@ jobs:
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v3
 
+      - name: Set up Docker Model
+        run: |
+          sudo apt-get install docker-model-plugin
+          docker model version
+          docker info
+
       - name: Set up Go
         uses: actions/setup-go@v5
         with:

+ 15 - 5
pkg/e2e/framework.go

@@ -224,13 +224,23 @@ func findPluginExecutable(pluginExecutableName string) (string, error) {
 	if err != nil {
 		return "", err
 	}
-	bin, err := filepath.Abs(filepath.Join(userDir, dockerUserDir, pluginExecutableName))
-	if err != nil {
-		return "", err
+	candidates := []string{
+		filepath.Join(userDir, dockerUserDir),
+		"/usr/local/lib/docker/cli-plugins",
+		"/usr/local/libexec/docker/cli-plugins",
+		"/usr/lib/docker/cli-plugins",
+		"/usr/libexec/docker/cli-plugins",
 	}
-	if _, err := os.Stat(bin); err == nil {
-		return bin, nil
+	for _, path := range candidates {
+		bin, err := filepath.Abs(filepath.Join(path, pluginExecutableName))
+		if err != nil {
+			return "", err
+		}
+		if _, err := os.Stat(bin); err == nil {
+			return bin, nil
+		}
 	}
+
 	return "", fmt.Errorf("plugin not found %s: %w", pluginExecutableName, os.ErrNotExist)
 }
 

+ 0 - 1
pkg/e2e/model_test.go

@@ -21,7 +21,6 @@ import (
 )
 
 func TestComposeModel(t *testing.T) {
-	t.Skip("require model-cli on GHA runners")
 	c := NewParallelCLI(t)
 	defer c.cleanupWithDown(t, "model-test")