Files
aptly/deb/graph_test.go
T
Nick Bozhenko 40ba104838 Add comprehensive CI/CD improvements and test coverage
This commit introduces major enhancements to the CI/CD pipeline and testing infrastructure:

CI/CD Improvements:
- Consolidated modern and legacy CI workflows into a single comprehensive pipeline
- Removed all publishing functionality from CI (no longer needed)
- Added 8 new advanced testing jobs for pull requests:
  * advanced-coverage: Detailed coverage analysis with base branch comparison
  * performance-profile: CPU and memory profiling with benchmarks
  * fuzz-test: Automated fuzz testing for supported packages
  * deep-analysis: Multiple static analysis tools (shadow, ineffassign, gosec, staticcheck)
  * mutation-test: Tests effectiveness of test suite on changed files
  * dependency-audit: Security vulnerabilities and outdated dependency checks
  * stress-test: Race detection with 100 iterations and parallel testing
  * test-report-summary: Aggregates all reports into a single PR comment
- Enabled RUN_LONG_TESTS by default for thorough testing
- Added automatic PR comment generation with all test results

Testing Infrastructure:
- Added comprehensive test files across all packages to improve coverage
- Implemented unit tests for previously untested packages
- Added race condition tests for concurrent operations
- Created integration tests for API endpoints
- Added storage backend tests (etcd, goleveldb)
- Implemented command-line interface tests

Local Testing Support:
- Added act configuration for testing GitHub Actions locally
- Created docker-compose.ci.yml for full CI environment simulation
- Updated CONTRIBUTING.md with detailed local testing instructions

Documentation Updates:
- Added comprehensive CI documentation to CONTRIBUTING.md
- Removed obsolete references to Travis CI
- Updated Go version requirements to 1.24
- Added act usage instructions and examples

Other Improvements:
- Updated .gitignore to exclude coverage reports and build artifacts
- Added test-act.yml workflow for testing act functionality
- Created CI_SUMMARY.md documenting all CI capabilities

These changes transform aptly's CI from a basic testing pipeline into a comprehensive quality assurance system that provides immediate feedback on code quality, performance, security, and test effectiveness.
2025-07-10 12:00:54 -04:00

42 lines
1.0 KiB
Go

package deb
import (
"github.com/aptly-dev/aptly/database/goleveldb"
. "gopkg.in/check.v1"
)
type GraphSuite struct {
collectionFactory *CollectionFactory
}
var _ = Suite(&GraphSuite{})
func (s *GraphSuite) SetUpTest(c *C) {
db, _ := goleveldb.NewOpenDB(c.MkDir())
s.collectionFactory = NewCollectionFactory(db)
}
func (s *GraphSuite) TearDownTest(c *C) {
// Collections are closed automatically when the test ends
}
func (s *GraphSuite) TestBuildGraphBasic(c *C) {
// Test BuildGraph with default (horizontal) layout
graph, err := BuildGraph(s.collectionFactory, "horizontal")
c.Check(err, IsNil)
c.Check(graph, NotNil)
}
func (s *GraphSuite) TestBuildGraphVertical(c *C) {
// Test BuildGraph with vertical layout
graph, err := BuildGraph(s.collectionFactory, "vertical")
c.Check(err, IsNil)
c.Check(graph, NotNil)
}
func (s *GraphSuite) TestBuildGraphUnknownLayout(c *C) {
// Test BuildGraph with unknown layout (should default to horizontal)
graph, err := BuildGraph(s.collectionFactory, "unknown")
c.Check(err, IsNil)
c.Check(graph, NotNil)
}