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
44 changes: 44 additions & 0 deletions openspec/specs/e2e-github-workflow/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Requirements

### Requirement: GitHub Actions e2e workflow with workflow_dispatch trigger
The project SHALL provide a GitHub Actions workflow at `.github/workflows/e2e.yaml` that runs e2e tests. The workflow SHALL be triggered only via `workflow_dispatch` (manual trigger). The workflow SHALL NOT run automatically on push or pull request events.

#### Scenario: Workflow is triggered manually
- **WHEN** a user triggers the e2e workflow via the GitHub Actions UI or API
- **THEN** the workflow starts and runs the e2e test matrix

#### Scenario: Workflow does not run on push
- **WHEN** code is pushed to any branch
- **THEN** the e2e workflow is NOT triggered

### Requirement: Matrix strategy with one job per distro/release tuple
The workflow SHALL use a GitHub Actions matrix strategy with one job per distro/release tuple. Each matrix entry SHALL define a display name, the Go test function name to run, and the release version. Each job SHALL appear as a separate entry in the GitHub Actions UI for clear failure isolation.

#### Scenario: Matrix produces separate jobs
- **WHEN** the e2e workflow is triggered
- **THEN** GitHub Actions creates one job per matrix entry, each visible as a separate row in the workflow run UI

#### Scenario: Each job runs exactly one distro test
- **WHEN** a matrix job executes
- **THEN** it runs only the Go test function specified by the matrix entry (e.g., `TestFedora`) with the release specified by `E2E_RELEASE`

### Requirement: 5-minute timeout per matrix job
Each matrix job SHALL have a `timeout-minutes` of 5.

#### Scenario: Job exceeds timeout
- **WHEN** a matrix job runs longer than 5 minutes
- **THEN** the job is cancelled by GitHub Actions

### Requirement: Matrix includes all supported distro/release tuples
The workflow matrix SHALL include the following distro/release tuples: Fedora 43, CentOS Stream 10, AlmaLinux 10, Rocky Linux 10, Debian trixie, Ubuntu noble, Arch Linux latest.

#### Scenario: All distros are represented in the matrix
- **WHEN** the e2e workflow is triggered
- **THEN** jobs are created for Fedora 43, CentOS Stream 10, AlmaLinux 10, Rocky Linux 10, Debian trixie, Ubuntu noble, and Arch Linux latest

### Requirement: Workflow job steps
Each matrix job SHALL checkout the repository, set up Go, and run the e2e test for the specific distro using `go test -tags e2e -run <TestFunction> ./test/e2e/` with the `E2E_RELEASE` environment variable set from the matrix.

#### Scenario: Job executes test with correct parameters
- **WHEN** a matrix job for Fedora 43 runs
- **THEN** it executes `go test -tags e2e -run TestFedora ./test/e2e/` with `E2E_RELEASE=43`
85 changes: 85 additions & 0 deletions openspec/specs/e2e-multi-distro/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
## Requirements

### Requirement: CentOS Stream e2e test
The test suite SHALL include a CentOS Stream test function `TestCentOSStream` using a `quay.io/centos/centos:stream10` container (or the release specified by `E2E_RELEASE`). The test SHALL configure dnf with a base repo pointing at the pkgproxy `centos-stream` repository, an EPEL repo pointing at the pkgproxy `epel` repository, and a COPR repo pointing at `ganto/jo` using the `epel-$releasever-$basearch` pattern. GPG verification SHALL be enabled for base and EPEL repos, disabled for COPR.

#### Scenario: CentOS Stream base package install succeeds
- **WHEN** the CentOS Stream container runs `dnf install -y tree` through pkgproxy
- **THEN** the command exits successfully and cached `.rpm` files exist under the `centos-stream/` cache subdirectory

#### Scenario: CentOS Stream EPEL metadata is accessible
- **WHEN** the CentOS Stream container runs `dnf makecache` with the EPEL repo configured
- **THEN** the command exits successfully (no cache assertion for EPEL)

#### Scenario: CentOS Stream COPR package install succeeds
- **WHEN** the CentOS Stream container runs `dnf install -y jo` from the COPR repository through pkgproxy
- **THEN** the command exits successfully and cached `.rpm` files exist under the `copr/` cache subdirectory

### Requirement: AlmaLinux e2e test
The test suite SHALL include an AlmaLinux test function `TestAlmaLinux` using a `docker.io/library/almalinux:10` container (or the release specified by `E2E_RELEASE`). The test SHALL configure dnf with a base repo pointing at the pkgproxy `almalinux` repository, an EPEL repo, and a COPR repo using the `epel-$releasever-$basearch` pattern.

#### Scenario: AlmaLinux base package install succeeds
- **WHEN** the AlmaLinux container runs `dnf install -y tree` through pkgproxy
- **THEN** the command exits successfully and cached `.rpm` files exist under the `almalinux/` cache subdirectory

#### Scenario: AlmaLinux EPEL metadata is accessible
- **WHEN** the AlmaLinux container runs `dnf makecache` with the EPEL repo configured
- **THEN** the command exits successfully

#### Scenario: AlmaLinux COPR package install succeeds
- **WHEN** the AlmaLinux container runs `dnf install -y jo` from the COPR repository through pkgproxy
- **THEN** the command exits successfully and cached `.rpm` files exist under the `copr/` cache subdirectory

### Requirement: Rocky Linux e2e test
The test suite SHALL include a Rocky Linux test function `TestRockyLinux` using a `docker.io/library/rockylinux:10` container (or the release specified by `E2E_RELEASE`). The test SHALL configure dnf with a base repo pointing at the pkgproxy `rockylinux` repository, an EPEL repo, and a COPR repo using the `epel-$releasever-$basearch` pattern.

#### Scenario: Rocky Linux base package install succeeds
- **WHEN** the Rocky Linux container runs `dnf install -y tree` through pkgproxy
- **THEN** the command exits successfully and cached `.rpm` files exist under the `rockylinux/` cache subdirectory

#### Scenario: Rocky Linux EPEL metadata is accessible
- **WHEN** the Rocky Linux container runs `dnf makecache` with the EPEL repo configured
- **THEN** the command exits successfully

#### Scenario: Rocky Linux COPR package install succeeds
- **WHEN** the Rocky Linux container runs `dnf install -y jo` from the COPR repository through pkgproxy
- **THEN** the command exits successfully and cached `.rpm` files exist under the `copr/` cache subdirectory

### Requirement: Ubuntu e2e test
The test suite SHALL include an Ubuntu test function `TestUbuntu` using a `docker.io/library/ubuntu:noble` container (or the release specified by `E2E_RELEASE`). The test SHALL configure apt with sources pointing at the pkgproxy `ubuntu` and `ubuntu-security` repositories. The `sources.list` SHALL be generated by the Go test and mounted into the container.

#### Scenario: Ubuntu metadata refresh succeeds
- **WHEN** the Ubuntu container runs `apt-get update` through pkgproxy
- **THEN** the command exits successfully

#### Scenario: Ubuntu package install succeeds
- **WHEN** the Ubuntu container runs `apt-get install -y tree` through pkgproxy
- **THEN** the command exits successfully and cached `.deb` files exist under the `ubuntu/` cache subdirectory

### Requirement: ubuntu-security repository in pkgproxy config
The pkgproxy configuration (`configs/pkgproxy.yaml`) SHALL include a `ubuntu-security` repository with `.deb` suffix and mirrors including `https://security.ubuntu.com/ubuntu/`.

#### Scenario: ubuntu-security repository is configured
- **WHEN** pkgproxy loads its configuration
- **THEN** the `ubuntu-security` repository is available with at least one upstream mirror

### Requirement: Fully qualified container image names
All e2e tests SHALL use fully qualified container image names including the registry (e.g., `docker.io/library/fedora:43`, `quay.io/centos/centos:stream10`). Tests SHALL NOT depend on container runtime defaults for registry resolution.

#### Scenario: Images use fully qualified names
- **WHEN** any e2e test starts a container
- **THEN** the image reference includes the full registry path

### Requirement: Architecture-independent repo configuration
All e2e test repo configurations SHALL use `$basearch` for architecture and `$releasever` for release version instead of hardcoded values. This SHALL allow the tests to run on both x86_64 and arm64 hosts.

#### Scenario: Repo files use variables not hardcoded values
- **WHEN** the Go test generates a `.repo` file or `sources.list`
- **THEN** the file uses `$basearch` and `$releasever` variables where supported by the package manager

### Requirement: COPR for non-Fedora DNF distros uses EPEL pattern
COPR repository configuration for non-Fedora DNF-based distros (CentOS Stream, AlmaLinux, Rocky Linux) SHALL use the URL pattern `/copr/ganto/jo/epel-$releasever-$basearch/`. Fedora SHALL continue using `/copr/ganto/jo/fedora-$releasever-$basearch/`.

#### Scenario: Non-Fedora COPR uses epel pattern
- **WHEN** the Go test generates a COPR repo file for AlmaLinux
- **THEN** the baseurl uses the pattern `http://<proxy>/copr/ganto/jo/epel-$releasever-$basearch/`
Loading
Loading