Skip to content

Commit

Permalink
Merge 1192c69 into 9c22e67
Browse files Browse the repository at this point in the history
  • Loading branch information
djshow832 authored Aug 13, 2024
2 parents 9c22e67 + 1192c69 commit 21f5bb4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/integrate-cluster-cmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
export PATH=$PATH:$GOPATH/bin
make build_integration_test
- uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '2.14.2'
- name: Build the docker-compose stack
working-directory: ${{ env.working-directory }}
# with --dev the first run will fail for unknow reason, just retry it and will success now..
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/integrate-cluster-scale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
export PATH=$PATH:$GOPATH/bin
make build_integration_test
- uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '2.14.2'
- name: Build the docker-compose stack
working-directory: ${{ env.working-directory }}
# with --dev the first run will fail for unknow reason, just retry it and will success now..
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/integrate-dm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ jobs:
make build_integration_test
make tiup
- uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '2.14.2'
- name: Build the docker-compose stack
working-directory: ${{ env.working-directory }}
# with --dev the first run will fail for unknow reason, just retry it and will success now..
Expand Down
31 changes: 31 additions & 0 deletions pkg/cluster/spec/parse_topology_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,37 @@ tiflash_servers:
})
}

func (s *topoSuite) TestMergeComponentVersions(c *check.C) {
// test component version overwrite
with2TempFile(`
component_versions:
tidb: v8.0.0
tikv: v8.0.0
tidb_servers:
- host: 172.16.5.139
`, `
component_versions:
tikv: v8.1.0
pd: v8.0.0
tidb_servers:
- host: 172.16.5.134
`, func(base, scale string) {
baseTopo := Specification{}
c.Assert(ParseTopologyYaml(base, &baseTopo), check.IsNil)

scaleTopo := baseTopo.NewPart()
c.Assert(ParseTopologyYaml(scale, scaleTopo), check.IsNil)

mergedTopo := baseTopo.MergeTopo(scaleTopo)
c.Assert(mergedTopo.Validate(), check.IsNil)

c.Assert(scaleTopo.(*Specification).ComponentVersions, check.Equals, mergedTopo.(*Specification).ComponentVersions)
c.Assert(scaleTopo.(*Specification).ComponentVersions.TiDB, check.Equals, "v8.0.0")
c.Assert(scaleTopo.(*Specification).ComponentVersions.TiKV, check.Equals, "v8.1.0")
c.Assert(scaleTopo.(*Specification).ComponentVersions.PD, check.Equals, "v8.0.0")
})
}

func (s *topoSuite) TestFixRelativePath(c *check.C) {
// base test
topo := Specification{
Expand Down
7 changes: 4 additions & 3 deletions pkg/cluster/spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ type UpgradableMetadata interface {
// NewPart implements ScaleOutTopology interface.
func (s *Specification) NewPart() Topology {
return &Specification{
GlobalOptions: s.GlobalOptions,
MonitoredOptions: s.MonitoredOptions,
ServerConfigs: s.ServerConfigs,
GlobalOptions: s.GlobalOptions,
MonitoredOptions: s.MonitoredOptions,
ServerConfigs: s.ServerConfigs,
ComponentVersions: s.ComponentVersions,
}
}

Expand Down

0 comments on commit 21f5bb4

Please sign in to comment.