MCPcopy Create free account
hub / github.com/github/gh-aw / TestExtractMetadataWithStopTime

Function TestExtractMetadataWithStopTime

pkg/workflow/lock_schema_test.go:578–592  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

576}
577
578func TestExtractMetadataWithStopTime(t *testing.T) {
579 // Test extracting metadata that includes stop time
580 stopTime := "2026-02-17 20:00:00"
581 content := `# gh-aw-metadata: {"schema_version":"v1","frontmatter_hash":"abc123","stop_time":"` + stopTime + `"}
582name: test
583`
584
585 metadata, isLegacy, err := ExtractMetadataFromLockFile(content)
586 require.NoError(t, err)
587 assert.False(t, isLegacy)
588 require.NotNil(t, metadata)
589 assert.Equal(t, LockSchemaV1, metadata.SchemaVersion)
590 assert.Equal(t, "abc123", metadata.FrontmatterHash)
591 assert.Equal(t, stopTime, metadata.StopTime, "Should extract stop time from metadata")
592}
593
594func TestLockMetadataToJSONWithStopTime(t *testing.T) {
595 // Test JSON serialization includes stop time when present

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected