Skip to content

Commit ba6f151

Browse files
committed
Add test-timing target
1 parent ca0125e commit ba6f151

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,26 @@ test-postgres-docker:
639639
done
640640
.PHONY: test-postgres-docker
641641

642+
build/go_tests.json: $(GO_SRC_FILES)
643+
go test ./... -list="." -json > "$@"
644+
645+
test-timing: build/go_tests.json
646+
# The timing tests intentionally run without parallelism to avoid flakiness.
647+
function test_cmds {
648+
cat "$<" \
649+
| jq -r '
650+
select(.Action == "output" and (.Output | test("_Timing\n")))
651+
| "go test \(.Package) -run=^\(.Output)"
652+
' \
653+
| grep -v ^$$
654+
}
655+
while read cmd; do
656+
echo "running $$cmd"
657+
$$cmd
658+
done < <(test_cmds)
659+
660+
.PHONY: test-timing
661+
642662
test-clean:
643663
go clean -testcache
644664
.PHONY: test-clean

agent/agent_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ func TestAgentMetadata_Timing(t *testing.T) {
10621062
greetingPath = filepath.Join(dir, "greeting")
10631063
script = "echo hello | tee -a " + greetingPath
10641064
)
1065+
//nolint:dogsled
10651066
_, client, _, _, _ := setupAgent(t, agentsdk.Manifest{
10661067
Metadata: []codersdk.WorkspaceAgentMetadataDescription{
10671068
{

0 commit comments

Comments
 (0)