Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/e2e/updatetest/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
func fetchDebPackageLatest(t *testing.T, path, repo string) string {
t.Helper()

repo = fmt.Sprintf("github.com/arduino/%s", repo)
repo = fmt.Sprintf("github.com/%s", repo)
cmd := exec.Command(
"gh", "release", "list",
"--repo", repo,
Expand Down
7 changes: 4 additions & 3 deletions internal/e2e/updatetest/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM debian:trixie

RUN apt update && \
apt install -y systemd systemd-sysv dbus \
apt install -y systemd systemd-sysv dbus initramfs-tools\
sudo docker.io ca-certificates curl gnupg \
dpkg-dev apt-utils adduser gzip && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -11,9 +11,10 @@ ARG ARCH=amd64
COPY build/stable/arduino-app-cli*_${ARCH}.deb /tmp/stable.deb
COPY build/arduino-app-cli*_${ARCH}.deb /tmp/unstable.deb
COPY build/stable/arduino-router*_${ARCH}.deb /tmp/router.deb
COPY build/stable/arduino-unoq-radio-firmware*_${ARCH}.deb /tmp/radio-firmware.deb

RUN apt update && apt install -y /tmp/stable.deb /tmp/router.deb \
&& rm /tmp/stable.deb /tmp/router.deb \
RUN apt update && apt install -y /tmp/stable.deb /tmp/radio-firmware.deb /tmp/router.deb \
&& rm /tmp/stable.deb /tmp/router.deb /tmp/radio-firmware.deb \
&& mkdir -p /var/www/html/myrepo/dists/trixie/main/binary-${ARCH} \
&& mv /tmp/unstable.deb /var/www/html/myrepo/dists/trixie/main/binary-${ARCH}/

Expand Down
14 changes: 9 additions & 5 deletions internal/e2e/updatetest/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ func TestUpdatePackage(t *testing.T) {
t.Run("Stable To Current", func(t *testing.T) {
t.Cleanup(func() { os.RemoveAll("build") })

tagAppCli := fetchDebPackageLatest(t, "build/stable", "arduino-app-cli")
fetchDebPackageLatest(t, "build/stable", "arduino-router")
tagAppCli := fetchDebPackageLatest(t, "build/stable", "arduino/arduino-app-cli")
fetchDebPackageLatest(t, "build/stable", "arduino/arduino-router")
fetchDebPackageLatest(t, "build/stable", "bcmi-labs/arduino-deb-packages")

majorTag := genMajorTag(t, tagAppCli)

fmt.Printf("Updating from stable version %s to unstable version %s \n", tagAppCli, majorTag)
Expand Down Expand Up @@ -71,8 +73,10 @@ func TestUpdatePackage(t *testing.T) {
t.Run("CurrentToStable", func(t *testing.T) {
t.Cleanup(func() { os.RemoveAll("build") })

tagAppCli := fetchDebPackageLatest(t, "build", "arduino-app-cli")
fetchDebPackageLatest(t, "build/stable", "arduino-router")
tagAppCli := fetchDebPackageLatest(t, "build", "arduino/arduino-app-cli")
fetchDebPackageLatest(t, "build/stable", "arduino/arduino-router")
fetchDebPackageLatest(t, "build/stable", "bcmi-labs/arduino-deb-packages")

minorTag := genMinorTag(t, tagAppCli)

fmt.Printf("Updating from unstable version %s to stable version %s \n", minorTag, tagAppCli)
Expand All @@ -83,7 +87,7 @@ func TestUpdatePackage(t *testing.T) {
const dockerImageName = "test-apt-update-unstable-image"

buildDockerImage(t, dockerFile, dockerImageName, arch)
//TODO: t cleanup remove docker image
// TODO: t cleanup remove docker image

t.Run("CLI Command", func(t *testing.T) {
const containerName = "apt-test-update-unstable"
Expand Down