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

Function TestGenerateLockMetadataReleaseBuild

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

Source from the content-addressed store, hash-verified

316}
317
318func TestGenerateLockMetadataReleaseBuild(t *testing.T) {
319 // Save and restore original values
320 originalIsRelease := isReleaseBuild
321 originalVersion := compilerVersion
322 defer func() {
323 isReleaseBuild = originalIsRelease
324 compilerVersion = originalVersion
325 }()
326
327 // Test release build
328 SetIsRelease(true)
329 SetVersion("v0.1.2")
330 hash := "abcd1234"
331 stopTime := "2026-02-17 20:00:00"
332 metadata := GenerateLockMetadata(LockHashInfo{FrontmatterHash: hash}, stopTime, false, AgentMetadataInfo{})
333
334 assert.NotNil(t, metadata, "Metadata should be created")
335 assert.Equal(t, LockSchemaV4, metadata.SchemaVersion, "Should use current schema version")
336 assert.Equal(t, hash, metadata.FrontmatterHash, "Should preserve frontmatter hash")
337 assert.Equal(t, stopTime, metadata.StopTime, "Should preserve stop time")
338 assert.Equal(t, "v0.1.2", metadata.CompilerVersion, "Release builds should include version")
339}
340
341func TestGenerateLockMetadataWithoutStopTime(t *testing.T) {
342 hash := "abcd1234"

Callers

nothing calls this directly

Calls 3

SetIsReleaseFunction · 0.85
SetVersionFunction · 0.85
GenerateLockMetadataFunction · 0.85

Tested by

no test coverage detected