Atlas › Test

pre-release_version

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

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

Co-introduced tests

6 other tests 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 6 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)
485 }
486 > return matches[1], nil main.go
487 }
488