Skip to content

test: migrate time_delta_test.go to testify#31768

Merged
pelikhan merged 3 commits into
mainfrom
copilot/improve-time-delta-test-quality
May 12, 2026
Merged

test: migrate time_delta_test.go to testify#31768
pelikhan merged 3 commits into
mainfrom
copilot/improve-time-delta-test-quality

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

pkg/workflow/time_delta_test.go had zero testify usage — 1284 lines of raw t.Errorf/t.Error, manual struct field comparisons, and a custom containsString/containsSubstring helper duplicating what testify provides out of the box.

Changes

pkg/workflow/time_delta_test.go

  • Import testify/assert and testify/require
  • Remove containsString / containsSubstring helpers
  • require.Error / require.NoError / require.NotNil for guard assertions that stop the test on failure
  • assert.Equal for all value and struct comparisons (replaces manual field-by-field checks)
  • assert.Contains for error message substring checks
  • Helpful context messages on every assertion

pkg/workflow/expression_coverage_test.go

  • Was importing the now-removed containsSubstring helper from the same package
  • Migrated to assert.Contains, assert.Equal, assert.ErrorContains, require.Error, require.NoError

Before / After

// Before
if result.Days != tt.expected.Days || result.Hours != tt.expected.Hours || result.Minutes != tt.expected.Minutes {
    t.Errorf("parseTimeDelta(%q) = {Days: %d, Hours: %d, Minutes: %d}, want {Days: %d, Hours: %d, Minutes: %d}",
        tt.input, result.Days, result.Hours, result.Minutes, tt.expected.Days, tt.expected.Hours, tt.expected.Minutes)
}

// After
assert.Equal(t, tt.expected, result, "parseTimeDelta(%q) result mismatch", tt.input)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name x_amd64/compile ath ../../../.prgit (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
  • https://api.github.com/orgs/owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/owner/actions/secrets --jq .secrets[].name go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build1931616740/b441/importcfg -pack /tmp/go-build1931616740/b441/_testmain.go dbox�� ./../pkg/workflow/js/**/*.json' --ignore-path dbox_mounts_test.go 64/pkg/tool/linux_amd64/vet dbox_validation./opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link dbox_validation_-o itize_incoming_t/tmp/go-build1931616740/b441/repoutil.test 64/pkg/tool/linu-importcfg (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name -c=4 -nolocalimports -importcfg /tmp/go-build1931616740/b443/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/semverutil/semverutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/semverutil/semverutil_test.go rev-�� ./../pkg/workflo-p .cfg 64/pkg/tool/linu-lang=go1.25 (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv "prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore --log-level=error x_amd64/vet Name,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle tierignore (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv uypkflb2T x_amd64/compile 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv ithout_min-integrity818687052/001 -buildtags k/gh-aw/gh-aw/actions/setup/node_modules/.bin/node ./../.prettierig/usr/bin/git -ifaceassert -nilfunc sh k/gh�� agent-persona-explorer.md DefaultBranchFromLsRemoteWithRealGitmain_branch7-test.run=^Test .cfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv 1616740/b462/timeutil.test !../../../pkg/workflow/js/**/*.json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv /ref/tags/v9 l sv remote.origin.urinfocmp (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 1461972730/.github/workflows **/*.cjs 64/pkg/tool/linux_amd64/link **/*.json --ignore-path ../../../.prettixterm-color 64/pkg/tool/linux_amd64/link /hom�� ts.test scripts/**/*.js 1/x64/bin/node .prettierignore --log-level=errorepo ules/.bin/prettiview J1c7b8qkFQ0vAYI1owner/repo (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 0323-17304/test-.artifacts[].name --write .cfg **/*.ts **/*.json --ignore-path /bin/sh -c rite '../../../**/*.json' '!../../../pkg/workflo-errorsas (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 1067933476/custom/workflows --write 64/pkg/tool/linux_amd64/vet **/*.ts **/*.json --ignore-path 64/pkg/tool/linux_amd64/vet 1434�� rite '../../../**/*.json' '!../../../pkg/workflow/js/**/*.json' --ignore-path 1434589/b001/_testmain.go 64/pkg/tool/linux_amd64/compile tierignore (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv licyBlockedUsersCommaSeparatedCoremote.upstream.url k/gh-aw/gh-aw/pkg/parser/import_cycle_test.go ache/node/24.14.1/x64/bin/node l -w -buildmode=exe /opt/hostedtoolcache/go/1.25.8/x--jq t-39�� k/gh-aw/gh-aw/.github/workflows/approach-validattest-logs/run-1 -trimpath kflow.test -p main layTitle kflow.test (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv k/gh-aw/gh-aw/.github/workflows/ai-moderator.md origin ache/node/24.14.1/x64/bin/node ath ../../../.prcut credential.helpe-f1 64/pkg/tool/linu../../../.pretti/repos/actions/github-script/git/ref/tags/v9 ache/node/24.14.1/x64/bin/node 9226�� git git /usr/bin/git remote.origin.urinfocmp 02/work layTitle git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv *.json' '!../../../pkg/workflow/js/**/*.json' --ignore-path ../../../.prettierig-importcfg --local 64/pkg/tool/linux_amd64/vet pull.rebase (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -c=4 -nolocalimports -importcfg /tmp/go-build1931616740/b125/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/cmd/gh-aw/main.go /home/REDACTED/work/gh-aw/gh-aw/cmd/gh-aw/capitalization_test.go /pre�� on' --ignore-path ../../../.prettierignore .cfg 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv celain --ignore-submodules | hea**/*.ts --local 64/pkg/tool/linux_amd64/vet ignore (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9.0.0
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv *.json' '!../../../pkg/workflow/js/**/*.json' ---p --local 64/pkg/tool/linux_amd64/vet commit.gpgsign (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv time-delta-test-**/*.ts --local /prettier ignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv celain --ignore-submodules | head -n 10 --local /node ignore (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv 0323-17304/test-1202802643 (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv artifacts-summary.md DefaultBranchFromLsRemoteWithRealGitmaster_branch1630413087/001' .cfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv npx prettier --write '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv runs/20260512-190323-17304/test-2324866900/.github/workflows -buildtags /usr/bin/git l -ifaceassert -nilfunc git -C /tmp/gh-aw-test-runs/20260512-190323-17304/test-source-field-variant-3267301050/.github/workflowgh url ache/node/24.14.1/x64/bin/node remote.origin.urls --local 64/pkg/tool/linu/tmp/gh-aw/aw-master.patch ache/node/24.14.1/x64/bin/node (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 1461972730 --write 64/pkg/tool/linu--limit **/*.ts **/*.json --ignore-path 64/pkg/tool/linux_amd64/compile /hom�� g_.a scripts/**/*.js ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet .prettierignore --log-level=erroapi node ache/go/1.25.8/x--jq (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 0323-17304/test-add-source-path-1719457662/.github/workflows --write 1/x64/bin/node **/*.ts **/*.json ode-gyp-bin/nodexterm-color npm t-ha�� vaScript2818796834/001/test-simple-frontmatter.m-errorsas stmain.go 64/pkg/tool/linux_amd64/vet tierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv 1067933476 --write 64/pkg/tool/linux_amd64/vet **/*.ts **/*.json --ignore-path 64/pkg/tool/linuremote.upstream.url /opt�� ternal/tools/generate-action-met--detach format:pkg-json ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv gpEPEKDLh --write ceutil.test **/*.ts **/*.json --ignore-path ceutil.test 9316�� edcfg (http block)
  • https://api.github.com/repos/aws-actions/configure-aws-credentials/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv -unreachable=false /tmp/go-build1931616740/b376/vet.cfg /usr/bin/infocmp ignore-path ../.infocmp --local x_amd64/vet infocmp -1 runs/20260512-190323-17304/test-1461972730/.github/workflows x_amd64/vet /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link l --local de /opt/hostedtoolc/tmp/gh-aw/aw-master.patch (http block)
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv licyMinIntegrityOnlymin-integrity_only_defaults_repo1496766/001 -trimpath /usr/bin/git l main -lang=go1.25 git -C ithub-script/git/ref/tags/v9 config ache/node/24.14.1/x64/bin/node remote.origin.urgit -c=4 -nolocalimports ache/node/24.14.1/x64/bin/node (http block)
  • https://api.github.com/repos/azure/login/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/azure/login/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv /tmp/go-build1931616740/b391/_pkg_.a -trimpath t -p main -lang=go1.25 gh api 3178771071 --jq ache/node/24.14.1/x64/bin/node -c=4 -nolocalimports -importcfg ache/node/24.14.--auto (http block)
  • https://api.github.com/repos/docker/login-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv t0 -trimpath (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv 1616740/b429/jsonutil.test (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv "prettier" --write '**/*.cjs' '**/*.ts' '**/*.js-test.timeout=10m0s -tests k/gh-aw/gh-aw/actions/setup/js/node_modules/.bin-test.short=true (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv "prettier" --write '**/*.cjs' '**/*.ts' '**/*.js--repo -tests 1/x64/bin/node (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-05-05 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-04-12 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-02-11 flow_test (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name itmain_branch758096617/002/work ache/uv/0.11.14/x86_64/sh (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 /tmp/go-build3215383396/b054/vet.cfg 1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name -buildtags 5383396/b247/vet.cfg -errorsas -ifaceassert -nilfunc erignore -uns�� */*.json' '!../../../pkg/workflow/js/**/*.json' --ignore-path /tmp/go-build3215383396/b186/vet.cfg 64/pkg/tool/linux_amd64/compile ath ../../../.pr/usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 -buildtags .cfg -errorsas -ifaceassert -nilfunc erignore -uns�� e_all)' /tmp/go-build3215383396/b194/vetmain 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1234567890
    • Triggering command: /usr/bin/gh gh api repos/{owner}/{repo}/actions/runs/1234567890 --jq {databaseId: .id, number: .run_number, url: .html_url, status: .status, conclusion: .conclusion, workflowName: .name, workflowPath: .path, createdAt: .created_at, startedAt: .run_started_at, updatedAt: .updated_at, event: .event, headBranch: .head_branch, --local rk 64/pkg/tool/linu../../../.prettierignore (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name /tmp/go-build3215383396/b103/vet.cfg 5383396/b282/vet.cfg (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 -buildtags x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet ache�� erate-action-met--detach /tmp/go-build3215383396/b195/vet-test.run=^Test 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name -trimpath ules/.bin/node -p github.com/stret-C -lang=go1.17 /opt/hostedtoolcstatus 1/x6�� c_test.go /tmp/go-build3215383396/b202/vetgithub.com/github/gh-aw/pkg/typeutil x_amd64/compile son -nolocalimports -importcfg x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 /tmp/go-build3215383396/b106/vet.cfg 5383396/b345/vet.cfg (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name /tmp/go-build3215383396/b038/vet.cfg bin/node (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 /tmp/go-build3215383396/b067/vetmain tions/setup/js/node_modules/.bin-lang=go1.25 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name /tmp/go-build3215383396/b046/vet.cfg ode (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 /tmp/go-build3215383396/b057/vet-w ache/node/24.14.1/x64/bin/npx (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name /tmp/go-build3215383396/b005/vet.cfg k/_temp/uv-python-dir/sh (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 itmaster_branch1630413087/002/work tions/node_modules/.bin/sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path h ../../../.prettierignore .cfg odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/sh (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build1931616740/b405/cli.test /tmp/go-build1931616740/b405/cli.test -test.testlogfile=/tmp/go-build1931616740/b405/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true son (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv se 1616740/b115/vet.cfg .git -errorsas -ifaceassert -nilfunc /usr/lib/git-core/git main�� run --auto /opt/hostedtoolcache/node/24.14.1/x64/bin/node --detach .cfg 64/pkg/tool/linuecho 'not found' >&2; exit 1 node (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv .js' --ignore-path .prettierignore --log-level=error l_workflow.go de_modules/.bin/node l_workflow_permigit l_workflow_permiremote r l_workflow_secreupstream tion�� te '../../../**/*.json' '!../../remote.upstream.url go 64/pkg/tool/linux_amd64/vet ignore (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv json' --ignore-p--exclude-hidden=receive 5383396/b020/vet--all x86_64/sh ./../.prettieriggit (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv '**/*.ts' '**/*.--detach 5383396/b024/vet-nolocalimports .cfg ./../.prettieriggit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv '**/*.ts' '**/*.go1.25.8 5383396/b028/vet-c=4 ache/go/1.25.8/x-nolocalimports ./../.prettieriginfocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv iant-483273988/.github/workflows (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv '**/*.ts' '**/*.go1.25.8 5383396/b025/vet-c=4 1/x64/bin/sh ./../.prettieriggh (http block)
  • https://api.github.com/repos/google-github-actions/auth/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/google-github-actions/auth/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv runs/20260512-190323-17304/test-21607031/.github/workflows -buildtags t -errorsas -ifaceassert -nilfunc git conf�� user.name Test User /usr/bin/git celain --ignore-head --local 64/pkg/tool/linu/tmp/gh-aw/aw-master.patch /usr/bin/git (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv mLsRemoteWithRealGitbranch_with_remote.upstream.url mLsRemoteWithRealGitbranch_with_hyphen1783403844/001' bin/node (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion -errorsas -ifaceassert erignore /opt/hostedtoolcorigin tion�� te '../../../**/*.json' '!../../remote.origin.url -buildtags son ignore -ifaceassert -nilfunc bash (http block)
  • https://api.github.com/repos/owner/repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/owner/repo/actions/secrets --jq .secrets[].name h ../../../.pret.prettierignore /node_modules/fl--log-level=error ode_modules/.bin/sh lization_test.gonode d_groups_test.go/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/pre�� _list_test.go 64/pkg/tool/linu../../../**/*.json ache�� w/js/**/*.json' --ignore-path .cfg 64/pkg/tool/linux_amd64/vet n_test.go ctions-build/mai-o r 64/pkg/tool/linu-trimpath (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state 64/pkg/tool/linux_amd64/compile ignore -ifaceassert -nilfunc 64/pkg/tool/linux_amd64/compile /opt�� g_.a format:cjs e_modules/.bin/node js/**/*.json' --git (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name h ../../../.pret.prettierignore committer.name de (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch -bool -buildtags /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/n-importcfg -errorsas -ifaceassert -nilfunc node /hom�� rite 'scripts/**/*.js' --ignore-path .prettierignore --log-level=error 2>&1 **/*.cjs bin/sh **/*.json --ignore-path ../../../.prettixterm-color node (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits May 12, 2026 19:04
…estify

- Add assert and require imports from testify
- Remove custom containsString/containsSubstring helpers
- Replace all t.Errorf/t.Error with assert.*/require.*
- Use assert.Equal for struct and value comparisons
- Use assert.Contains for error message checks
- Also migrate expression_coverage_test.go which depended on the helpers"

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7203bd1a-a976-4e2b-a1ee-809f029f5f7f

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…coverage_test.go

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7203bd1a-a976-4e2b-a1ee-809f029f5f7f

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve test quality in pkg/workflow/time_delta_test.go test: migrate time_delta_test.go to testify May 12, 2026
Copilot AI requested a review from gh-aw-bot May 12, 2026 19:07
@pelikhan pelikhan marked this pull request as ready for review May 12, 2026 19:12
Copilot AI review requested due to automatic review settings May 12, 2026 19:12
@pelikhan pelikhan merged commit 2380eca into main May 12, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/improve-time-delta-test-quality branch May 12, 2026 19:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates workflow unit tests from manual testing.T error handling and custom substring helpers to testify assertions for clearer failures and less boilerplate.

Changes:

  • Updated pkg/workflow/time_delta_test.go to use require.* for guard checks and assert.* for value comparisons and substring checks.
  • Removed custom containsString/containsSubstring helpers in favor of assert.Contains.
  • Updated pkg/workflow/expression_coverage_test.go to use assert/require (including assert.ErrorContains) and to stop depending on the removed helper.
Show a summary per file
File Description
pkg/workflow/time_delta_test.go Replace manual t.Errorf/field-by-field checks and custom substring helpers with testify assertions.
pkg/workflow/expression_coverage_test.go Migrate assertions to testify and remove reliance on the deleted substring helper.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines 19 to 28
@@ -22,41 +23,34 @@ func TestBuildFromAllowedForksSingleCondition(t *testing.T) {
result := BuildFromAllowedForks([]string{})
rendered := result.Render()
// Should not have DisjunctionNode wrapping for single condition
if rendered != "github.event.pull_request.head.repo.id == github.repository_id" {
t.Errorf("BuildFromAllowedForks with empty list should return single condition without OR")
}
assert.Equal(t, "github.event.pull_request.head.repo.id == github.repository_id", rendered,
"BuildFromAllowedForks with empty list should return single condition without OR")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[testify-expert] Improve Test Quality: pkg/workflow/time_delta_test.go

4 participants