Skip to content

Commit 3eb2776

Browse files
committed
no parameters
1 parent 559aa48 commit 3eb2776

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

internal/testtools/deb_test.go

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ var arch = flag.String("arch", "amd64", "target architecture")
2020

2121
func TestStableToUnstable(t *testing.T) {
2222
fmt.Printf("***** ARCH %s ***** \n", *arch)
23-
tagAppCli := FetchDebPackage(t, "arduino-app-cli", "latest", *arch)
24-
FetchDebPackage(t, "arduino-router", "latest", *arch)
23+
tagAppCli := FetchDebPackage(t, "arduino-app-cli", "latest", "amd64")
24+
FetchDebPackage(t, "arduino-router", "latest", "amd64")
2525
majorTag := majorTag(t, tagAppCli)
2626
_ = minorTag(t, tagAppCli)
2727

28+
ls(t)
29+
2830
fmt.Printf("Updating from stable version %s to unstable version %s \n", tagAppCli, majorTag)
2931
fmt.Printf("Building local deb version %s \n", majorTag)
3032
buildDebVersion(t, majorTag, *arch)
@@ -173,13 +175,7 @@ func minorTag(t *testing.T, tag string) string {
173175
func buildDockerImage(t *testing.T, dockerfile, name, arch string) {
174176
t.Helper()
175177

176-
cmd := exec.Command(
177-
"docker", "buildx", "build",
178-
"--platform", "linux/amd64",
179-
"-t", name,
180-
"-f", dockerfile,
181-
".",
182-
)
178+
cmd := exec.Command("docker", "build", "-t", name, "-f", dockerfile, ".")
183179
// Capture both stdout and stderr
184180
var out bytes.Buffer
185181
var stderr bytes.Buffer
@@ -288,3 +284,25 @@ func moveDeb(t *testing.T, startDir, targetDir, repo string, tagVersion string,
288284
panic(fmt.Errorf("failed to move deb file: %w", err))
289285
}
290286
}
287+
288+
func ls(t *testing.T) {
289+
t.Helper()
290+
cwd, err := os.Getwd()
291+
if err != nil {
292+
fmt.Println("Error getting working directory:", err)
293+
return
294+
}
295+
296+
fmt.Println("Current directory:", cwd)
297+
fmt.Println("Listing all files and folders recursively:")
298+
299+
// Walk through all files and subdirectories
300+
err = filepath.Walk(cwd, func(path string, info os.FileInfo, err error) error {
301+
if err != nil {
302+
return err
303+
}
304+
fmt.Println(path)
305+
return nil
306+
})
307+
308+
}

internal/testtools/test.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ RUN apt update && \
88

99
ARG ARCH=amd64
1010

11-
COPY build/stable/arduino-app-cli*.deb /tmp/stable.deb
12-
COPY build/arduino-app-cli*.deb /tmp/unstable.deb
13-
COPY build/stable/arduino-router*.deb /tmp/router.deb
11+
COPY build/stable/arduino-app-cli*_${ARCH}.deb /tmp/stable.deb
12+
COPY build/arduino-app-cli*_${ARCH}.deb /tmp/unstable.deb
13+
COPY build/stable/arduino-router*_${ARCH}.deb /tmp/router.deb
1414

1515
RUN apt update && apt install -y /tmp/stable.deb /tmp/router.deb \
1616
&& rm /tmp/stable.deb /tmp/router.deb \

0 commit comments

Comments
 (0)