MCPcopy Index your code
hub / github.com/bytebase/bytebase / TestCheckVersionCompatibility

Function TestCheckVersionCompatibility

action/command/root_test.go:20–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18)
19
20func TestCheckVersionCompatibility(t *testing.T) {
21 t.Parallel()
22
23 tests := []struct {
24 name string
25 cliVersion string
26 serverVersion string
27 wantError string
28 }{
29 {
30 name: "same release version",
31 cliVersion: "3.14.0",
32 serverVersion: "3.14.0",
33 },
34 {
35 name: "release version within two minor versions",
36 cliVersion: "3.13.0",
37 serverVersion: "3.15.0",
38 },
39 {
40 name: "release version outside two minor versions",
41 cliVersion: "3.12.0",
42 serverVersion: "3.15.0",
43 wantError: "outside the compatibility window",
44 },
45 {
46 name: "newer release version is outside window",
47 cliVersion: "3.17.0",
48 serverVersion: "3.15.0",
49 wantError: "outside the compatibility window",
50 },
51 {
52 name: "release version with different major is outside window",
53 cliVersion: "2.15.0",
54 serverVersion: "3.15.0",
55 wantError: "outside the compatibility window",
56 },
57 {
58 name: "plain cloud action is not a dated cloud build",
59 cliVersion: "cloud-20260604",
60 serverVersion: "cloud",
61 wantError: "unable to parse",
62 },
63 {
64 name: "plain cloud server is not a dated cloud build",
65 cliVersion: "cloud",
66 serverVersion: "cloud-20260604",
67 wantError: "unable to parse",
68 },
69 {
70 name: "dated cloud builds match",
71 cliVersion: "cloud-20260604",
72 serverVersion: "cloud-20260604",
73 },
74 {
75 name: "dated cloud builds within seven days",
76 cliVersion: "cloud-20260604",
77 serverVersion: "cloud-20260611",

Callers

nothing calls this directly

Calls 4

RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected