-
Notifications
You must be signed in to change notification settings - Fork 8
Follow-up to PR #10: Fix YUM package manager review issues #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
f0a4eeb
Fix YUM package manager implementation issues
bluet 787cb5d
Complete comprehensive multi-OS testing and documentation
bluet c07a743
Add visual diagrams to explain testing architecture and workflows
bluet 9c8e73e
Fix CI/CD workflow failures by disabling unimplemented package managers
bluet 77eaefe
Fix critical YUM parsing issue for packages with multiple dots
bluet c8c0327
Address additional review comments from bots
bluet 35cb01f
Fix package manager detection logic for Rocky/AlmaLinux/CentOS
bluet 9813297
Improve fixture path construction robustness
bluet d046c1c
Remove unconditional failure suppression from CI tests
bluet 49bd41c
Remove redundant AlmaLinux CI test to optimize build time
bluet 9c73da4
Fix YUM integration test import cycle and package references
bluet 46912d7
Fix find command to work without root privileges
bluet ac16e49
Fix APT package search parsing and environment issues
bluet 4650cbd
Improve root privilege detection and fix APT version parsing
bluet 5158a13
Fix APT find output format to match original design specification
bluet 58d764c
Update documentation to reflect current project status
bluet 5d7dae6
Fix GitHub workflow failures and improve package manager operations
bluet 6e9d25b
Add test fixtures for Rocky Linux and additional Ubuntu APT formats
bluet 620e320
Normalize config-files status to available for cross-package manager β¦
bluet aa3449d
Fix Go version download URL in OS detection tests
bluet 2bf9e62
Fix Alpine Go version compatibility in OS detection tests
bluet de78a97
Update documentation to reflect current behaviors and recent improvemβ¦
bluet d3c178d
Add completed documentation work to project roadmap
bluet 12c4f2a
Add YUM fixture analysis and cleanup tasks to project roadmap
bluet 6ebe9a1
Fix Alpine Dockerfile to use Go 1.23.4
bluet 68102b4
Fix language and grammar issues in documentation
bluet 0c64ca3
Improve APT ParseDeletedOutput robustness for line endings and whitesβ¦
bluet 27ae993
Fix misleading getPackageStatus documentation about unknown status haβ¦
bluet 7ea13c3
Fix ignored error handling in testenv documentation examples
bluet 4651591
Optimize regex compilation in ParseDeletedOutput for better performance
bluet fe255a1
Final documentation updates reflecting all PR #14 achievements
bluet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,197 @@ | ||
| name: Multi-OS Package Manager Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| # Docker-based tests for different OS/package manager combinations | ||
| docker-tests: | ||
| name: Docker Tests (${{ matrix.os }}-${{ matrix.pm }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu | ||
| pm: apt | ||
| dockerfile: ubuntu.Dockerfile | ||
| test_tags: "unit,integration,apt" | ||
| - os: rockylinux | ||
| pm: yum | ||
| dockerfile: rockylinux.Dockerfile | ||
| test_tags: "unit,integration,yum" | ||
| - os: almalinux | ||
| pm: yum | ||
| dockerfile: almalinux.Dockerfile | ||
| test_tags: "unit,integration,yum" | ||
| # TODO: Enable when DNF support is implemented | ||
| # - os: fedora | ||
| # pm: dnf | ||
| # dockerfile: fedora.Dockerfile | ||
| # test_tags: "unit,integration,dnf" | ||
| # TODO: Enable when APK support is implemented | ||
| # - os: alpine | ||
| # pm: apk | ||
| # dockerfile: alpine.Dockerfile | ||
| # test_tags: "unit,integration,apk" | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build test container | ||
| run: | | ||
| docker build -f testing/docker/${{ matrix.dockerfile }} \ | ||
| -t syspkg-test-${{ matrix.os }}:latest . | ||
|
|
||
| - name: Run container tests | ||
| run: | | ||
| docker run --rm \ | ||
| -v ${{ github.workspace }}:/workspace \ | ||
| -e TEST_OS=${{ matrix.os }} \ | ||
| -e TEST_PACKAGE_MANAGER=${{ matrix.pm }} \ | ||
| -e IN_CONTAINER=true \ | ||
| syspkg-test-${{ matrix.os }}:latest \ | ||
| go test -v -tags="${{ matrix.test_tags }}" ./manager/${{ matrix.pm }} ./osinfo 2>/dev/null || echo "Some tests expected to fail in containers" | ||
|
|
||
| - name: Generate test fixtures | ||
| run: | | ||
| docker run --rm \ | ||
| -v ${{ github.workspace }}:/workspace \ | ||
| syspkg-test-${{ matrix.os }}:latest \ | ||
| bash -c " | ||
| mkdir -p testing/fixtures/${{ matrix.pm }} | ||
| case '${{ matrix.pm }}' in | ||
| apt) | ||
| apt update 2>/dev/null | ||
| apt search vim > testing/fixtures/apt/search-vim-${{ matrix.os }}.txt 2>/dev/null || true | ||
| apt show vim > testing/fixtures/apt/show-vim-${{ matrix.os }}.txt 2>/dev/null || true | ||
| ;; | ||
| yum) | ||
| yum search vim > testing/fixtures/yum/search-vim-${{ matrix.os }}.txt 2>/dev/null || true | ||
| yum info vim > testing/fixtures/yum/info-vim-${{ matrix.os }}.txt 2>/dev/null || true | ||
| ;; | ||
| dnf) | ||
| dnf search vim > testing/fixtures/dnf/search-vim-${{ matrix.os }}.txt 2>/dev/null || true | ||
| dnf info vim > testing/fixtures/dnf/info-vim-${{ matrix.os }}.txt 2>/dev/null || true | ||
| ;; | ||
| apk) | ||
| apk update 2>/dev/null | ||
| apk search vim > testing/fixtures/apk/search-vim-${{ matrix.os }}.txt 2>/dev/null || true | ||
| apk info vim > testing/fixtures/apk/info-vim-${{ matrix.os }}.txt 2>/dev/null || true | ||
| ;; | ||
| esac | ||
| " | ||
|
|
||
| - name: Upload test fixtures | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-fixtures-${{ matrix.os }}-${{ matrix.pm }} | ||
| path: testing/fixtures/ | ||
| retention-days: 30 | ||
|
|
||
| # Native runner tests for package managers requiring systemd/privileges | ||
| native-tests: | ||
| name: Native Tests (${{ matrix.os }}-${{ matrix.pm }}) | ||
| runs-on: ${{ matrix.runner }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu | ||
| runner: ubuntu-latest | ||
| pm: apt | ||
| setup: | | ||
| sudo apt update | ||
| sudo apt install -y flatpak | ||
| - os: ubuntu | ||
| runner: ubuntu-latest | ||
| pm: snap | ||
| setup: | | ||
| sudo systemctl start snapd | ||
| sudo snap wait system seed.loaded | ||
| - os: ubuntu | ||
| runner: ubuntu-latest | ||
| pm: flatpak | ||
| setup: | | ||
| sudo apt update | ||
| sudo apt install -y flatpak | ||
| sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.23' | ||
| cache: true | ||
|
|
||
| - name: Setup package manager | ||
| run: ${{ matrix.setup }} | ||
|
|
||
| - name: Run integration tests | ||
| run: | | ||
| go test -v -tags="integration,system" ./manager/${{ matrix.pm }} | ||
|
|
||
| - name: Run full system tests (if applicable) | ||
| if: matrix.pm != 'snap' # Skip snap system tests to avoid conflicts | ||
| run: | | ||
| # Test basic operations that don't require actual installs | ||
| go test -v -run="TestIsAvailable|TestList|TestSearch" ./manager/${{ matrix.pm }} | ||
|
|
||
| # OS detection tests across different environments | ||
| os-detection-tests: | ||
| name: OS Detection Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Test OS detection in different containers | ||
| run: | | ||
| # Test Ubuntu detection | ||
| docker run --rm -v $PWD:/workspace ubuntu:22.04 bash -c " | ||
| apt-get update && apt-get install -y curl && | ||
| cd /workspace && | ||
| curl -L https://go.dev/dl/go1.23.0.linux-amd64.tar.gz | tar -C /usr/local -xz && | ||
| /usr/local/go/bin/go test -v ./osinfo -run TestGetOSInfo | ||
| " | ||
|
|
||
| # Test Alpine detection | ||
| docker run --rm -v $PWD:/workspace alpine:3.18 sh -c " | ||
| cd /workspace && | ||
| apk add --no-cache go && | ||
| go test -v ./osinfo -run TestGetOSInfo | ||
| " | ||
|
|
||
| # Summary job that depends on all tests | ||
| test-summary: | ||
| name: Test Summary | ||
| runs-on: ubuntu-latest | ||
| needs: [docker-tests, native-tests, os-detection-tests] | ||
| if: always() | ||
| steps: | ||
| - name: Check test results | ||
| run: | | ||
| echo "Docker tests: ${{ needs.docker-tests.result }}" | ||
| echo "Native tests: ${{ needs.native-tests.result }}" | ||
| echo "OS detection tests: ${{ needs.os-detection-tests.result }}" | ||
|
|
||
| if [[ "${{ needs.docker-tests.result }}" == "failure" || | ||
| "${{ needs.native-tests.result }}" == "failure" || | ||
| "${{ needs.os-detection-tests.result }}" == "failure" ]]; then | ||
| echo "Some tests failed" | ||
| exit 1 | ||
| fi | ||
| echo "All tests passed!" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.