Skip to content

Commit e0a673e

Browse files
IntegrationStandardsPaperclip-Paperclip
andcommitted
ci: wire compat-test bundle from quantcli/common against crono-export
Adds the build-tag-gated `compat_contract_test.go` and a new CI workflow that: 1. Builds the crono-export binary. 2. Resolves the github.com/quantcli/common/compat dependency via `go mod tidy` (the package itself is stdlib-only and hermetic). 3. Runs `go test -tags=compat -run TestContractDates ./...` against the built binary, with CRONO_EXPORT_BIN pointing at it. A failing test here means crono drifted from CONTRACT §3 or §5. **Stacked on quantcli/common#6** — the require line points at the pseudo-version of that branch's HEAD commit, so the workflow only goes green once #6 merges to main and the proxy reindexes. The require version will be rebased onto a merged-main pseudo-version (or a tagged release if we cut one) before flipping this PR ready. Refs QUA-8. Co-Authored-By: Paperclip <[email protected]>
1 parent 4d679f0 commit e0a673e

3 files changed

Lines changed: 76 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
go:
14+
name: go vet + test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version-file: go.mod
21+
cache: true
22+
- name: go vet
23+
run: go vet ./...
24+
- name: go test
25+
run: go test ./...
26+
27+
compat:
28+
name: compat (CONTRACT machine-attestation)
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-go@v5
33+
with:
34+
go-version-file: go.mod
35+
cache: true
36+
- name: resolve compat dependency
37+
# The compat module lives at github.com/quantcli/common/compat
38+
# under a subpath. `go mod tidy` materializes go.sum for it on
39+
# first run; subsequent runs are cache-served.
40+
run: go mod tidy
41+
- name: build crono-export
42+
run: go build -o /tmp/crono-export .
43+
- name: run compat suite
44+
env:
45+
# Path the compat-tagged test reads from os.Getenv.
46+
CRONO_EXPORT_BIN: /tmp/crono-export
47+
run: go test -tags=compat -run TestContractDates ./...

compat_contract_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//go:build compat
2+
3+
// Compat-test entry point for crono-export-cli.
4+
//
5+
// This file is only compiled under the `compat` build tag, so it does
6+
// not affect the default `go test ./...` run. CI invokes it as
7+
// `go test -tags=compat ./...` after building the export binary and
8+
// exposing its path through CRONO_EXPORT_BIN.
9+
//
10+
// The actual assertions live in github.com/quantcli/common/compat.
11+
// Drift between this CLI and CONTRACT.md surfaces as a failure here.
12+
package main_test
13+
14+
import (
15+
"os"
16+
"testing"
17+
18+
"github.com/quantcli/common/compat"
19+
"github.com/quantcli/common/compat/dates"
20+
)
21+
22+
func TestContractDates(t *testing.T) {
23+
bin := os.Getenv("CRONO_EXPORT_BIN")
24+
if bin == "" {
25+
t.Skip("CRONO_EXPORT_BIN not set; skipping compat suite")
26+
}
27+
dates.RunContract(t, compat.Runner{Binary: bin})
28+
}

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.25.5
44

55
require (
66
github.com/jrmycanady/gocronometer v1.5.1
7+
github.com/quantcli/common/compat v0.0.0-20260510223424-1882283f6817
78
github.com/spf13/cobra v1.10.2
89
)
910

0 commit comments

Comments
 (0)