Atlas › Test

empty_output

Exact test identity: go.temporal.io/server/.github/actions/build-docker-images/scripts/TestParseTemporalVersion/empty_output

Package
go.temporal.io/server/.github/actions/build-docker-images/scripts
Suite / test hierarchy
TestParseTemporalVersion/empty_output
Test
empty_output
Introduced at
main.go ×1 Frontier kind: Joint frontier
Covered ranges
2
Covered lines
7
Covered files
1

Co-introduced tests

1 other test enter at the same concept.

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/.github/actions/build-docker-images/scripts/main.go 7 covered LOC · 2 ranges

Open complete file

477 // parseTemporalVersion extracts the version from output like
478 // "temporal version 1.29.0" or "temporal version 0.0.0-DEV (Server 1.30.1, UI 2.45.3)"
479 > func parseTemporalVersion(output string) (string, error) { main.go
480 > s := strings.TrimSpace(output)
481 > re := regexp.MustCompile(`^temporal version\s+(\d+\.\d+\.\d+\S*)`)
482 > matches := re.FindStringSubmatch(s)
483 > if len(matches) < 2 {
484 > return "", fmt.Errorf("failed to parse version from output: %s", s) main.go
485 > }
486 return matches[1], nil
487 }