mirror of
				https://github.com/1Password/onepassword-operator.git
				synced 2025-10-31 11:49:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			766 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			766 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| # Testing
 | |
| 
 | |
| ## Unit & Integration tests
 | |
| **When**: Unit (pure Go) and integration (controller-runtime envtest).
 | |
| **Where**: `internal/...`, `pkg/...`
 | |
| **Add files in**: `*_test.go` next to the code.
 | |
| **Run**: `make test`
 | |
| 
 | |
| ## E2E tests (kind)
 | |
| **When**: Full cluster behavior (CRDs, operator image, Connect/SA flows).
 | |
| **Where**: `test/e2e/...`
 | |
| **Add files in**: `*_test.go` next to the code.
 | |
| **Framework**: Ginkgo + `pkg/testhelper`.
 | |
| 
 | |
| **Local prep**:
 | |
| 1. [Install `kind`](https://kind.sigs.k8s.io/docs/user/quick-start/#installing-with-a-package-manager) to spin up local Kubernetes cluster.
 | |
| 2. `export OP_CONNECT_TOKEN=<token>`
 | |
| 3. `export OP_SERVICE_ACCOUNT_TOKEN=<token>`
 | |
| 4. `make test-e2e`
 | |
| 5. Put `1password-credentials.json` into project root.
 | |
| 
 | |
| **Run**: `make test-e2e`
 | 
