go-devops/tests/cli/devops/Taskfile.yaml

92 lines
2.6 KiB
YAML
Raw Normal View History

version: "3"
tasks:
default:
cmds:
- task: test
test:
cmds:
- task: test:deploy:plan
- task: test:deploy:ansible
- task: test:health
test:deploy:plan:
desc: Validate the deploy command surface.
dir: ../../..
cmds:
- |
fix(devops): address CodeRabbit findings on PR #2 15+ findings dispositioned. AX-6-conformant — no testify reintroduced. Code fixes: - cmd/dev/service.go: no-op now returns OK:true, unchecked prompt type assertion guarded - cmd/workspace/config.go: relative parent traversal blocked + regression test, fmt.Errorf wrapping - cmd/dev/cmd_issues.go + cmd_reviews.go: import ordering - tests/cli/devops/main.go: raw WalkDir errors wrapped - tests/cli/devops/Taskfile.yaml: strict shell flags - cmd/vanity-import/Dockerfile + docs/development.md: Go 1.26 alignment - locales/embed.go: missing dappco.re/go/i18n checksum Test infra: - New local test helpers in cmd/dev, cmd/setup, devkit, snapshot - All testify usages already absent — local stdlib helpers preferred per AX-6 ban - Test naming aligned (Test{Filename}_{Function}_{Good,Bad,Ugly} per AX-10) Disposition replies (RESOLVED-COMMENT, no testify added): - cmd/dev/cmd_apply_test.go, cmd/setup/cmd_ci_test.go, snapshot_test.go, devkit/coverage_test.go: CodeRabbit testify suggestions get reasoning reply per AX-6 ban; local helpers are convention. - SonarCloud/GHAS: no PR checks/annotations found; code-scanning API returned no analysis, secret scanning disabled. Verification: gofmt clean, git diff --check clean, no testify imports. Targeted go vet + go test pass for cmd/workspace + devkit + snapshot. Full go vet ./... blocked by pre-existing dappco.re/go/scm codeberg.org/forgejo/go-sdk auth/replacement issue (out of scope). Closes findings on https://github.com/dAppCore/go-devops/pull/2 Co-authored-by: Codex <noreply@openai.com>
2026-04-27 15:07:24 +01:00
set -euo pipefail
IFS=$'\n\t'
export GOWORK=off
export GOCACHE="${GOCACHE:-/tmp/go-devops-gocache}"
export GOMODCACHE="${GOMODCACHE:-/tmp/go-devops-gomodcache}"
mkdir -p "$GOCACHE" "$GOMODCACHE"
bin="$(mktemp -t go-devops-cli.XXXXXX)"
out="$(mktemp -t go-devops-deploy.XXXXXX)"
trap 'rm -f "$bin" "$out"' EXIT
go build -o "$bin" ./tests/cli/devops
"$bin" deploy --help >"$out"
grep -Eq "servers|projects|apps|Coolify" "$out"
echo "deploy plan smoke passed: deploy command surface available"
test:deploy:ansible:
desc: Validate bundled playbook YAML for the deploy smoke path.
dir: ../../..
cmds:
- |
fix(devops): address CodeRabbit findings on PR #2 15+ findings dispositioned. AX-6-conformant — no testify reintroduced. Code fixes: - cmd/dev/service.go: no-op now returns OK:true, unchecked prompt type assertion guarded - cmd/workspace/config.go: relative parent traversal blocked + regression test, fmt.Errorf wrapping - cmd/dev/cmd_issues.go + cmd_reviews.go: import ordering - tests/cli/devops/main.go: raw WalkDir errors wrapped - tests/cli/devops/Taskfile.yaml: strict shell flags - cmd/vanity-import/Dockerfile + docs/development.md: Go 1.26 alignment - locales/embed.go: missing dappco.re/go/i18n checksum Test infra: - New local test helpers in cmd/dev, cmd/setup, devkit, snapshot - All testify usages already absent — local stdlib helpers preferred per AX-6 ban - Test naming aligned (Test{Filename}_{Function}_{Good,Bad,Ugly} per AX-10) Disposition replies (RESOLVED-COMMENT, no testify added): - cmd/dev/cmd_apply_test.go, cmd/setup/cmd_ci_test.go, snapshot_test.go, devkit/coverage_test.go: CodeRabbit testify suggestions get reasoning reply per AX-6 ban; local helpers are convention. - SonarCloud/GHAS: no PR checks/annotations found; code-scanning API returned no analysis, secret scanning disabled. Verification: gofmt clean, git diff --check clean, no testify imports. Targeted go vet + go test pass for cmd/workspace + devkit + snapshot. Full go vet ./... blocked by pre-existing dappco.re/go/scm codeberg.org/forgejo/go-sdk auth/replacement issue (out of scope). Closes findings on https://github.com/dAppCore/go-devops/pull/2 Co-authored-by: Codex <noreply@openai.com>
2026-04-27 15:07:24 +01:00
set -euo pipefail
IFS=$'\n\t'
export GOWORK=off
export GOCACHE="${GOCACHE:-/tmp/go-devops-gocache}"
export GOMODCACHE="${GOMODCACHE:-/tmp/go-devops-gomodcache}"
mkdir -p "$GOCACHE" "$GOMODCACHE"
bin="$(mktemp -t go-devops-cli.XXXXXX)"
out="$(mktemp -t go-devops-playbooks.XXXXXX)"
trap 'rm -f "$bin" "$out"' EXIT
go build -o "$bin" ./tests/cli/devops
"$bin" playbook-smoke playbooks >"$out"
grep -q "playbook smoke passed" "$out"
echo "deploy ansible smoke passed: playbook YAML decoded"
test:health:
desc: Validate core dev health output against a temporary registry.
dir: ../../..
cmds:
- |
fix(devops): address CodeRabbit findings on PR #2 15+ findings dispositioned. AX-6-conformant — no testify reintroduced. Code fixes: - cmd/dev/service.go: no-op now returns OK:true, unchecked prompt type assertion guarded - cmd/workspace/config.go: relative parent traversal blocked + regression test, fmt.Errorf wrapping - cmd/dev/cmd_issues.go + cmd_reviews.go: import ordering - tests/cli/devops/main.go: raw WalkDir errors wrapped - tests/cli/devops/Taskfile.yaml: strict shell flags - cmd/vanity-import/Dockerfile + docs/development.md: Go 1.26 alignment - locales/embed.go: missing dappco.re/go/i18n checksum Test infra: - New local test helpers in cmd/dev, cmd/setup, devkit, snapshot - All testify usages already absent — local stdlib helpers preferred per AX-6 ban - Test naming aligned (Test{Filename}_{Function}_{Good,Bad,Ugly} per AX-10) Disposition replies (RESOLVED-COMMENT, no testify added): - cmd/dev/cmd_apply_test.go, cmd/setup/cmd_ci_test.go, snapshot_test.go, devkit/coverage_test.go: CodeRabbit testify suggestions get reasoning reply per AX-6 ban; local helpers are convention. - SonarCloud/GHAS: no PR checks/annotations found; code-scanning API returned no analysis, secret scanning disabled. Verification: gofmt clean, git diff --check clean, no testify imports. Targeted go vet + go test pass for cmd/workspace + devkit + snapshot. Full go vet ./... blocked by pre-existing dappco.re/go/scm codeberg.org/forgejo/go-sdk auth/replacement issue (out of scope). Closes findings on https://github.com/dAppCore/go-devops/pull/2 Co-authored-by: Codex <noreply@openai.com>
2026-04-27 15:07:24 +01:00
set -euo pipefail
IFS=$'\n\t'
export GOWORK=off
export GOCACHE="${GOCACHE:-/tmp/go-devops-gocache}"
export GOMODCACHE="${GOMODCACHE:-/tmp/go-devops-gomodcache}"
mkdir -p "$GOCACHE" "$GOMODCACHE"
bin="$(mktemp -t go-devops-cli.XXXXXX)"
tmp="$(mktemp -d)"
out="$(mktemp -t go-devops-health.XXXXXX)"
trap 'rm -f "$bin" "$out"; rm -rf "$tmp"' EXIT
mkdir -p "$tmp/packages/alpha"
git -C "$tmp/packages/alpha" init -q
cat >"$tmp/repos.yaml" <<YAML
version: 1
org: test
base_path: $tmp/packages
repos:
alpha:
type: module
YAML
go build -o "$bin" ./tests/cli/devops
"$bin" dev health --registry "$tmp/repos.yaml" >"$out"
grep -q "1 repos" "$out"
grep -q "up to date" "$out"
echo "health smoke passed: dev health validated temporary registry"