diff --git a/.cursorrules b/.cursorrules new file mode 120000 index 00000000000..47dc3e3d863 --- /dev/null +++ b/.cursorrules @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000000..25ae9642323 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,22 @@ +# Repository AI Guidelines + +Before adding to this file, carefully consider that poorly written AGENTS.md files can hurt task success rates, while also increasing token usage. + +## E2E Testing Guidelines (`test/openshift/e2e/ginkgo/**/*`) + +When creating or modifying Ginkgo E2E test files: + +### General Guidelines + +- **Avoid `k8sClient.Update(...)`**: This call will occasionally fail due to Kubernetes resources being modified between the Get and Update calls. + - Instead, use fixture-specific `Update` functions. Most fixture packages include an `Update` function, for example for `ArgoCD` CR: use `argocdFixture.Update(...)`. For generic resource update, see `k8sFixture.Update(...)`. + +### Parallel Tests (`test/openshift/e2e/ginkgo/parallel/*_test.go`) + +- Use `Describe("GitOps Operator Parallel E2E Tests", func() { ... })` as the top-level describe block +- Call `fixture.EnsureParallelCleanSlate()` in the `BeforeEach` function. (not `EnsureSequentialCleanSlate`) + +### Sequential Tests (`test/openshift/e2e/ginkgo/sequential/*_test.go`) + +- Use `Describe("GitOps Operator Sequential E2E Tests", func() { ... })` as the top-level describe block +- Call `fixture.EnsureSequentialCleanSlate()` in the `BeforeEach` function. (not `EnsureParallelCleanSlate`) \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 00000000000..47dc3e3d863 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file