e2e/README.md
The E2E tests in this directory are designed to test Trivy's functionality in realistic environments with external dependencies and network connectivity. These tests complement unit tests and integration tests by focusing on scenarios that require real external resources.
E2E tests should focus on functionality that involves:
E2E tests should avoid detailed assertions and comprehensive validation:
The E2E tests build and execute trivy in isolated temporary directories. When you run mage test:e2e, it automatically:
t.TempDir())This approach ensures:
# Run all E2E tests
mage test:e2e
# Run specific test
go test -v -tags=e2e ./e2e/ -run TestE2E/image_scan
# Update golden files when output changes
go test -v -tags=e2e ./e2e/ -update
When adding new E2E tests: