mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
Make Playwright runs hermetic and fix stale race-hub specs
Six suite failures had rotted in: three race-hub specs targeted the sub-tabbed Race Story UI deleted in the Phase 22 redesign, and the command-center specs depended on the real OpenF1 calendar, whose focus weekend drifted away from the seeded Monaco session as time passed. The e2e/visual configs now point BOXBOX_OPENF1_BASE_URL (new override) at an unreachable address so runs are hermetic and date-stable; the race-hub specs were rewritten against the current RaceStoryCanvas UI, and the one drifted mobile snapshot regenerated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
12
cmd/main.go
12
cmd/main.go
@@ -41,11 +41,19 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
// BOXBOX_OPENF1_BASE_URL overrides the upstream OpenF1 API root. E2E runs
|
||||
// point it at an unreachable address so tests stay hermetic and
|
||||
// deterministic regardless of wall-clock date or network state.
|
||||
baseURL := os.Getenv("BOXBOX_OPENF1_BASE_URL")
|
||||
if baseURL == "" {
|
||||
baseURL = "https://api.openf1.org"
|
||||
}
|
||||
|
||||
var client *api.OpenF1Client
|
||||
if apiKey := os.Getenv("OPENF1_API_KEY"); apiKey != "" {
|
||||
client = api.NewOpenF1ClientWithKey("https://api.openf1.org", 15*time.Second, apiKey)
|
||||
client = api.NewOpenF1ClientWithKey(baseURL, 15*time.Second, apiKey)
|
||||
} else {
|
||||
client = api.NewOpenF1Client("https://api.openf1.org", 15*time.Second)
|
||||
client = api.NewOpenF1Client(baseURL, 15*time.Second)
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user