Skip to content

fix: pre-existing test failures across 15+ packages in CI #77

@CodeMonkeyCybersecurity

Description

Summary

After fixing CGO compilation in CI (#74), many pre-existing test failures are now visible that were previously masked by build failures. These need to be fixed package by package.

Failing Packages (ci-unit)

Package Test Root Cause
pkg/backup TestSaveConfig/save_invalid_config Expects validation error, gets mkdir /etc/eos: permission denied (CI has no /etc/eos)
pkg/btrfs TestCreateSubvolume_ErrorPaths Error message mismatch: gets "device path cannot be empty" but expects "parent path does not exist"
pkg/btrfs TestDeviceHasFilesystem_Mock Expected false, actual true
pkg/btrfs TestCreateSnapshot_Validation Error message mismatch
pkg/cephfs FuzzConfigStructValidation/seed#2 Negative MON count (-1), dangerous device path not rejected
pkg/clean TestSanitizeName_EdgeCases Long filename and tabs/newlines handling
pkg/clean TestPathOperations current_directory and Windows_path cases
pkg/cloudinit TestGeneratorValidateConfig_Comprehensive hostname_too_long, invalid_hostname_characters, empty_username
pkg/container Various 37s runtime, likely timeout or Docker dependency
pkg/crypto Various 51s runtime
pkg/crypto/pq Various Post-quantum crypto tests
pkg/database_management Various Database dependency
pkg/docker Various Docker dependency
pkg/eos_err Various Error handling tests
pkg/eos_io Various IO tests
pkg/eos_postgres Various Postgres dependency

Failing Packages (ci-integration)

Package Test Root Cause
pkg/vault TestSecureRootTokenFallback Calls PromptSecret in CI (no TTY), panics on nil reader after 900s timeout

Categories

  1. Error message mismatches (btrfs, clean, cloudinit): Tests assert specific error strings that changed. Fix by updating assertions.
  2. CI environment dependencies (backup, container, docker, postgres): Tests need root/Docker/Postgres. Fix with t.Skip guards or CI service containers.
  3. TTY-dependent tests (vault): Tests call interactive prompts. Fix with t.Skip when os.Stdin is not a terminal.
  4. Validation gaps (cephfs): Fuzz tests finding real input validation issues. Fix the validators.
  5. Long-running tests (container, crypto): May need -timeout increase or -short skip.

Priority

P2 - These don't affect production code, only CI reliability.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions