Package Group - GitLab Quality Assurance End-to-End Testing for the Package group
Testing Strategy
Local Development Testing
-
Unit Tests
- Container Registry (Go):
make test
- Package Registry (Rails):
bundle exec rspec ee/spec/models/packages/
- Frontend:
yarn jest ee/spec/frontend/packages
- Container Registry (Go):
-
Integration Tests
- Test against different storage backends
- Verify API endpoints
- Check authorization rules
End-to-End Testing
The Package group uses GitLab QA for E2E testing. This is crucial for features that integrate multiple services.
Common Test Scenarios
-
Container Registry
# Publishing a container image Resource::Container::Image.fabricate_via_api! do |image| image.name = 'my-image' image.repository_name = 'my-project' end
-
Package Registry
# Publishing an npm package Resource::Package::Npm.fabricate_via_api! do |package| package.name = 'my-package' package.version = '1.0.0' end
Test Environment Setup
Local Testing with GDK
-
Set required environment variables:
export QA_DEBUG=true export WEBDRIVER_HEADLESS=false
-
Ensure GDK is using a loopback interface
-
Map hostname to the loopback interface
Testing File Uploads
Test uploads against multiple storage backends:
- Local storage (default)
- Object storage:
- GCP (recommended for GitLab.com parity)
- MinIO (local development)
- AWS S3
- Azure
HackyStack Demo Environment
For ephemeral demos with Omnibus and Container Registry:
- Login to
https://gitlabsandbox.cloud
- Select Cloud Account ID
dev-package-container-96a3ff34
- Get credentials from View Credentials tab
- Launch environment using Play icon
- Run CI/CD pipeline
- Manually trigger Deploy action
- Access demo project using provided credentials
- Clean up by triggering Destroy job when done
Testing Tools
Seeding Utilities
-
- Quick creation of test images
- Supports multiple architectures
-
Container Registry Cloud Seeder
- Bulk image creation
- Load testing support
Troubleshooting
Common Issues
-
Storage backend connectivity
# Check GCS credentials gsutil ls gs://your-bucket # Verify S3 access aws s3 ls s3://your-bucket
-
Registry authentication
# Test registry login docker login registry.gitlab.com
-
Package publishing failures
- Verify project/group permissions
- Check storage quotas
- Validate package metadata
Documentation
Last modified February 13, 2025: Revamp the Package handbook pages (
3b1c3a3d
)