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
29 changes: 29 additions & 0 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Go Tests

# Security: grants only the minimal scopes required.
permissions:
contents: read

on:
pull_request:
paths:
- "go/**"

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
cache-dependency-path: go/go.sum

# Runs test with shuffle and count to expose flaky tests.
- name: Run tests
working-directory: go
run: go test -count=5 -shuffle=on ./...
14 changes: 7 additions & 7 deletions go/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,22 @@ func TestClient_GetLatestReport(t *testing.T) {
}

func TestClient_GetReportPage(t *testing.T) {
expectedInitialTS := uint64(1234567891)
expectedInitialTS := uint64(1234567890)

expectedReportPage1 := &ReportPage{
Reports: []*ReportResponse{
{FeedID: feed1, FullReport: hexutil.Bytes(`report1 payload`)},
{FeedID: feed1, FullReport: hexutil.Bytes(`report2 payload`)},
{FeedID: feed1, ObservationsTimestamp: 1234567890, FullReport: hexutil.Bytes(`report1 payload`)},
{FeedID: feed1, ObservationsTimestamp: 1234567891, FullReport: hexutil.Bytes(`report2 payload`)},
},
NextPageTS: 1234567899,
NextPageTS: 1234567892,
}

expectedReportPage2 := &ReportPage{
Reports: []*ReportResponse{
{FeedID: feed1, FullReport: hexutil.Bytes(`report3 payload`)},
{FeedID: feed1, FullReport: hexutil.Bytes(`report4 payload`)},
{FeedID: feed1, ObservationsTimestamp: 1234567892, FullReport: hexutil.Bytes(`report3 payload`)},
{FeedID: feed1, ObservationsTimestamp: 1234567893, FullReport: hexutil.Bytes(`report4 payload`)},
},
NextPageTS: 1234567999,
NextPageTS: 1234567894,
}

ms := newMockServer(func(w http.ResponseWriter, r *http.Request) {
Expand Down