How to run timing based test splitting in Golang?

My tests are in this structure:

  • services/
    • dir1/
      • a.go
      • a_test.go
    • other.go
    • other_test.go

Here is the command I use to try to use the timing data:

- run:
      name: Run unit tests
      shell: /bin/bash
      command: |
        PACKAGE_NAMES=$(go list ./services/... | circleci tests split --split-by=timings --timings-type=classname)
        mkdir -p /tmp/test-results/services
        gotestsum --junitfile /tmp/test-results/services/result.xml -- -tags sometag -timeout 240m $PACKAGE_NAMES
      no_output_timeout: 4h
- store_test_results: 
    path: /tmp/test-results

It outputs:

No timing found for “
No timing found for “

What am I doing wrong?

Note: I tried to follow this:

1 Like