mirror of
https://github.com/taigrr/systemctl.git
synced 2026-03-09 00:14:38 -07:00
fix(errors): prioritize permission errors over 'does not exist' warnings (#11)
filterErr checked 'does not exist' before 'Interactive authentication required', so when systemd printed both (common for mask/unmask on non-installed units as a non-root user), the wrong error was returned. Reorder checks so permission, bus, and masked errors take priority over existence warnings. Add tests covering mixed-stderr scenarios. Also: - CI: install and start nginx so user + root tests pass - CI: run tests as both user and root for full coverage - Bump Go 1.26 → 1.26.1
This commit is contained in:
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@@ -25,14 +25,24 @@ jobs:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
|
||||
- name: Run tests with race detection and coverage
|
||||
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
|
||||
- name: Install and start nginx
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq nginx
|
||||
sudo systemctl start nginx
|
||||
sudo systemctl enable nginx
|
||||
|
||||
- name: Run tests (user)
|
||||
run: go test -race -coverprofile=coverage-user.out -covermode=atomic ./...
|
||||
|
||||
- name: Run tests (root)
|
||||
run: sudo go test -race -coverprofile=coverage-root.out -covermode=atomic ./...
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
if: matrix.go-version == '1.26'
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
files: coverage.out
|
||||
files: coverage-user.out,coverage-root.out
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user