Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Classify each risk as Technical, Security, UX/Product, or Operational, and repor
- Persisted formats (TUF metadata and keys, release bundles, S3/MinIO storage layout) need backward compatibility.
- `*_linux.go` / `*_others.go` pairs and the Linux-only server plugin must stay consistent; a reviewer on macOS cannot compile the CGO server side at all.
- Use `samber/lo` helpers only in `server/` — they are not available in `client/` or `release/`.
- Build and test only via `task` commands, never raw Go tools. AI-authored tests must be `*_ai_test.go`, tagged `//go:build ai_tests`, with `TestAI_`-prefixed functions.
- Build and test only via `task` commands, never raw Go tools.

## Output

Expand Down
52 changes: 8 additions & 44 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,6 @@ jobs:
unit_server:
name: Tests
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: server/go.mod

- name: Install Task
uses: go-task/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y gpg
task --yes server:deps:install:c

- name: Set up git config
run: task --yes ci:setup:git-config

- name: Install 3p-git-signatures
run: task --yes ci:install:3p-git-signatures

- name: Install ginkgo
run: task --yes deps:install:ginkgo

- name: Test
run: |
task --yes server:test:unit

- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: unit_coverage
path: tests_coverage

ai_tests_server:
name: AI-authored tests
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v6
Expand Down Expand Up @@ -103,7 +61,14 @@ jobs:
- name: Test
env:
TRDL_SMOKE_BUILDKITD_ADDRESS: tcp://127.0.0.1:1234
run: task --yes server:test:ai
run: |
task --yes server:test:unit

- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: unit_coverage
path: tests_coverage

unit_client:
name: Client unit tests
Expand Down Expand Up @@ -330,7 +295,6 @@ jobs:
if: always()
needs:
- unit_server
- ai_tests_server
- unit_client
- e2e_tests
- e2e_buildkit
Expand Down
3 changes: 1 addition & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ ALWAYS use these `task` commands. NEVER use raw `go build`, `go test`, `go fmt`,
- `logboek.Context(ctx)` returns the default logger ONLY for exactly `context.Background()`; any derived context without a bound logger panics with `context is not bound with logboek logger`. In a test that reaches code logging through logboek, pass `context.Background()` unchanged or wrap it: `logboek.NewContext(ctx, logboek.DefaultLogger())`.
- Server tests use Ginkgo/Gomega. `testify` (`assert`, `require`) is also available in the `server/` module.
- E2E tests use Ginkgo/Gomega exclusively.
- When writing tests as an AI agent → ALWAYS name the file `*_ai_test.go`, add `//go:build ai_tests` build tag, prefix test functions with `TestAI_`.
- ALWAYS place tests alongside source files, not in a separate directory.
- Test helpers go in `helpers_test.go` (or `helpers_ai_test.go` for AI-written helpers).
- Test helpers go in `helpers_test.go`.
- Test fixtures go in `testdata/` subdirectory next to the tests.

## PR review guidelines (MANDATORY)
Expand Down
4 changes: 2 additions & 2 deletions e2e/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ tasks:
outputDir: '{{.outputDir | default "../tests_coverage/e2e" }}'

test:e2e:mac-signing:
desc: "Run mac signing e2e test against a stub quill (ai_tests tag, excluded from the default run)."
cmd: ginkgo --vv --keep-going --tags=ai_tests --cover --covermode=atomic --coverpkg=github.com/werf/trdl/client/...,github.com/werf/trdl/server/... --output-dir={{.outputDir}} ./tests/mac_signing
desc: "Run mac signing e2e test against a stub quill."
cmd: ginkgo --vv --keep-going --cover --covermode=atomic --coverpkg=github.com/werf/trdl/client/...,github.com/werf/trdl/server/... --output-dir={{.outputDir}} ./tests/mac_signing
vars:
outputDir: '{{.outputDir | default "../tests_coverage/e2e" }}'
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build ai_tests
// +build ai_tests

package mac_signing

import (
Expand All @@ -25,7 +22,7 @@ import (
// credentials. It builds _fixtures/quill_stub and serves it from a throwaway
// registry; that quill validates the five QUILL_* env vars and appends a marker
// with the received cert and notary key id to the artifact. Asserting the marker
// in the published artifact proves the Vault-stored credential values travelled
// in the published artifact proves the Vault-stored credential values traveled
// through the buildkit secret mounts into the signer stage, the Mach-O detection
// loop ran, and the "signed" artifact was re-exported through the final scratch
// stage.
Expand Down
6 changes: 0 additions & 6 deletions e2e/tests/mac_signing/doc.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build ai_tests
// +build ai_tests

package mac_signing

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build ai_tests
// +build ai_tests

package mac_signing

import (
Expand All @@ -14,7 +11,7 @@ import (
"github.com/werf/trdl/server/pkg/testutil"
)

func TestAI_MacSigning(t *testing.T) {
func TestMacSigning(t *testing.T) {
testutil.MeetsRequirementTools([]string{"docker", "git", "git-signatures", "gpg"})
RegisterFailHandler(Fail)
RunSpecs(t, "Mac Signing Suite")
Expand Down
6 changes: 0 additions & 6 deletions server/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,6 @@ tasks:
outputDir: '{{.outputDir | default "../tests_coverage/unit"}}'
paths: '{{.paths | default "./..."}}'

test:ai:
desc: 'Run server tests written by AI agents (ai_tests build tag). Set TRDL_SMOKE_BUILDKITD_ADDRESS to include the buildkitd smoke test. Important vars: "paths".'
cmd: ginkgo --vet=off --race --keep-going --tags=ai_tests {{.paths}}
vars:
paths: '{{.paths | default "./..."}}'

verify:dist:binaries:
desc: "Verify that the distributable binaries are built and have correct platform/arch."
cmds:
Expand Down
191 changes: 0 additions & 191 deletions server/path_configure_ai_test.go

This file was deleted.

Loading
Loading