2025-12-09 05:31:55 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
2025-12-14 17:12:48 +01:00
|
|
|
IMAGE="pkgmgr-${PKGMGR_DISTRO}"
|
2025-12-09 05:31:55 +01:00
|
|
|
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
echo
|
|
|
|
|
echo "------------------------------------------------------------"
|
2025-12-14 17:12:48 +01:00
|
|
|
echo ">>> Testing VENV: ${IMAGE}"
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
echo "------------------------------------------------------------"
|
2025-12-09 05:31:55 +01:00
|
|
|
|
2025-12-14 17:12:48 +01:00
|
|
|
echo "[test-env-virtual] Inspect image metadata:"
|
|
|
|
|
docker image inspect "${IMAGE}" | sed -n '1,40p'
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
echo
|
2025-12-09 05:31:55 +01:00
|
|
|
|
2025-12-14 17:12:48 +01:00
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# Run VENV-based pkgmgr test inside container
|
|
|
|
|
# ------------------------------------------------------------
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
if OUTPUT=$(docker run --rm \
|
2025-12-14 17:12:48 +01:00
|
|
|
-e REINSTALL_PKGMGR=1 \
|
2025-12-17 11:03:02 +01:00
|
|
|
-v "$(pwd):/opt/src/pkgmgr" \
|
|
|
|
|
-w /opt/src/pkgmgr \
|
2025-12-14 17:12:48 +01:00
|
|
|
"${IMAGE}" \
|
|
|
|
|
bash -lc '
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
echo "[test-env-virtual] Installing pkgmgr (distro package)..."
|
|
|
|
|
make install
|
|
|
|
|
|
|
|
|
|
echo "[test-env-virtual] Setting up Python venv..."
|
|
|
|
|
make setup-venv
|
|
|
|
|
|
|
|
|
|
echo "[test-env-virtual] Activating venv..."
|
|
|
|
|
. "$HOME/.venvs/pkgmgr/bin/activate"
|
|
|
|
|
|
|
|
|
|
echo "[test-env-virtual] Using pkgmgr from:"
|
|
|
|
|
command -v pkgmgr
|
|
|
|
|
pkgmgr --help
|
|
|
|
|
' 2>&1); then
|
|
|
|
|
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
echo "$OUTPUT"
|
2025-12-09 05:31:55 +01:00
|
|
|
echo
|
2025-12-14 17:12:48 +01:00
|
|
|
echo "[test-env-virtual] SUCCESS: venv-based pkgmgr works in ${IMAGE}"
|
2025-12-09 05:31:55 +01:00
|
|
|
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
else
|
|
|
|
|
echo "$OUTPUT"
|
|
|
|
|
echo
|
2025-12-14 17:12:48 +01:00
|
|
|
echo "[test-env-virtual] ERROR: venv-based pkgmgr failed in ${IMAGE}"
|
Refactor CI distro handling and container build scripts
- Introduce a GitHub Actions matrix for `test-container` and `test-e2e`
to run against arch, debian, ubuntu, fedora, and centos
- Run unit and integration tests only in the Arch container by passing
`distro="arch"` via make in the corresponding workflows
- Replace the global DISTROS loop with a single `distro` variable in
the Makefile, defaulting to `arch`, and export it for all scripts
- Update build scripts (build-image, build-image-no-cache, build-image-missing)
to build images for the selected distro only
- Simplify test-container script to validate a single distro image using
the `distro` environment variable
- Simplify E2E, unit, and integration test scripts to run against a
single distro container instead of iterating over all distros
https://chatgpt.com/share/693acbba-9e30-800f-94fb-fea4489e9078
2025-12-11 14:48:36 +01:00
|
|
|
exit 1
|
2025-12-14 17:12:48 +01:00
|
|
|
fi
|