Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Add baremetal cluster e2e test #206

Closed
wants to merge 110 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
c84c1af
Merge pull request #1 from GreptimeTeam/develop
confoc May 23, 2024
85002b5
Merge branch 'GreptimeTeam:develop' into develop
confoc May 28, 2024
71081cc
ifx
Jun 12, 2024
0e0f9b9
fix2
Jun 13, 2024
693a722
fix2
Jun 14, 2024
7f9be86
fix3
Jun 14, 2024
eacc7bc
fix3
Jun 14, 2024
d6ade88
fix4
Jun 14, 2024
3b2ed05
fix4
Jun 14, 2024
c43ef9c
fix5
Jun 17, 2024
ab3a329
fix6
Jun 17, 2024
bb5e7a0
fix7
Jun 17, 2024
41a46d4
fix8
Jun 17, 2024
79e2c10
fix9
Jun 18, 2024
f45e9d6
fix9
Jun 18, 2024
6c240c4
fix10
Jun 21, 2024
6ad8083
fix10
Jun 21, 2024
0c2990c
fix11
Jun 21, 2024
a0beacb
fix11
Jun 21, 2024
dcf2ec6
fix11
Jun 21, 2024
a5d4d42
fix11
Jun 21, 2024
b0232ae
fix11
Jun 21, 2024
30f595e
fix11
Jun 21, 2024
c94f907
fix11
Jun 21, 2024
1b02bbe
fix11
Jun 21, 2024
219fb5b
fix11
Jun 21, 2024
6206249
fix11
Jun 24, 2024
e4fb8a6
fix11
Jun 24, 2024
7208120
fix11
Jun 24, 2024
8f857a5
fix11
Jun 24, 2024
fdf91cf
fix11
Jun 24, 2024
7e9282d
fix11
Jun 24, 2024
367747c
fix11
Jun 24, 2024
d1319ab
fix11
Jun 24, 2024
dc9dca7
fix11
Jun 24, 2024
83f8b0c
fix11
Jun 24, 2024
be56c09
fix11
Jun 24, 2024
5d4163d
fix11
Jun 24, 2024
1983aa6
fix11
Jun 24, 2024
4e897b6
fix11
Jun 24, 2024
87ea15b
fix11
Jun 24, 2024
0615d55
fix11
Jun 24, 2024
5395aed
fix11
Jun 24, 2024
5dba756
fix11
Jun 24, 2024
15e7a2d
fix11
Jun 24, 2024
36e834b
fix11
Jun 24, 2024
3868fde
fix11
Jun 24, 2024
ca70fd6
fix11
Jun 24, 2024
71befb3
fix11
Jun 24, 2024
1d54fef
fix12
Jun 24, 2024
98638d7
fix13
Jun 25, 2024
1d3d4c2
fix13
Jun 25, 2024
7429d48
fix
Jun 25, 2024
f6dc85d
fix
Jun 25, 2024
d856ccf
fix
Jun 25, 2024
21d1c8e
fix
Jun 25, 2024
2ee7b5a
fix
Jun 25, 2024
fb4a186
fix
Jun 25, 2024
3780228
fix
Jun 25, 2024
f4fb200
fix
Jun 25, 2024
d5dd305
fix
Jun 25, 2024
2476fab
fix
Jun 25, 2024
c1fcddc
fix
Jun 25, 2024
d078660
fix
Jun 25, 2024
f7ba7e9
fix
Jun 25, 2024
8706ef8
fix
Jun 25, 2024
d73bdab
fix
Jun 25, 2024
deb5dc7
fix
Jun 25, 2024
656891b
fix
Jun 25, 2024
fd4ffb8
fix
Jun 25, 2024
5a54f7d
fix
Jun 25, 2024
d6a5ee3
fix
Jun 26, 2024
468ab6a
fix
Jun 26, 2024
2f16d46
fix
Jun 26, 2024
5f37a4b
fix
Jun 26, 2024
ede1032
fix
Jun 26, 2024
8c3495a
fix
Jun 28, 2024
7301c86
fix
Jun 28, 2024
b279748
fix
Jun 28, 2024
21751b4
fix
Jun 28, 2024
308a24c
fix
Jun 28, 2024
e5b6383
fix
Jun 28, 2024
5bc5328
fix
Jun 28, 2024
61b60ea
fix
Jun 28, 2024
6bc0b94
fix
Jun 28, 2024
6d9497c
fix
Jul 1, 2024
a482888
fix
Jul 1, 2024
28379a4
fix
Jul 1, 2024
f5d417e
fix
Jul 1, 2024
2879eb8
closeport
Jul 1, 2024
a9357c0
changeport
Jul 1, 2024
9dab097
changeport
Jul 1, 2024
0245666
test
Jul 1, 2024
d2ef0e1
test
Jul 1, 2024
95be0d7
test
Jul 1, 2024
c4a1b1b
test
Jul 1, 2024
0f6b624
test
Jul 1, 2024
63f9f69
foeward
Jul 2, 2024
ab43e0b
baremetalport
Jul 2, 2024
d9e58a7
baremetalport
Jul 2, 2024
2813881
mysqladress
Jul 2, 2024
a994084
sql
Jul 5, 2024
a7eca4b
sql
Jul 5, 2024
a60de7e
fix
Jul 5, 2024
dc4c406
fix
Jul 5, 2024
5a56011
fix
Jul 5, 2024
d4f0dd5
fix
Jul 5, 2024
a4f2fc0
close
Jul 5, 2024
33f15b5
sql
Jul 9, 2024
3ab89fb
sql
Jul 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cluster/baremetal/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (c *Cluster) Create(ctx context.Context, options *opt.CreateOptions) error
return nil
}

if c.useMemoryMeta {
if !c.useMemoryMeta {
if err := withSpinner("Etcd Cluster", c.createEtcdCluster); err != nil {
return err
}
Expand Down
45 changes: 45 additions & 0 deletions tests/e2e/greptimedbcluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ var _ = Describe("Basic test of greptimedb cluster", func() {
err = listCluster()
Expect(err).NotTo(HaveOccurred(), "failed to list cluster")

go func() {
err = createClusterinBaremetal()
Expect(err).NotTo(HaveOccurred(), "failed to create cluster in baremetal")
}()

go func() {
time.Sleep(100 * time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: It is not recommended to use the sleep. You can modify it to periodically detect whether the port is connected and set a timeout.


err = getClusterinBaremetal()
Expect(err).NotTo(HaveOccurred(), "failed to get cluster in baremetal")

err = deleteClusterinBaremetal()
Expect(err).NotTo(HaveOccurred(), "failed to delete cluster in baremetal")
}()

go func() {
forwardRequest()
}()
Expand Down Expand Up @@ -151,6 +166,16 @@ func createCluster() error {
return nil
}

func createClusterinBaremetal() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "create", "mydb", "--bare-metal")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
return nil
}

func getCluster() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "get", "mydb")
cmd.Stdout = os.Stdout
Expand All @@ -161,6 +186,16 @@ func getCluster() error {
return nil
}

func getClusterinBaremetal() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "get", "mydb", "--bare-metal")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
return nil
}

func listCluster() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "list")
cmd.Stdout = os.Stdout
Expand All @@ -181,6 +216,16 @@ func deleteCluster() error {
return nil
}

func deleteClusterinBaremetal() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "delete", "mydb", "--tear-down-etcd", "--bare-metal")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
return nil
}

func forwardRequest() {
for {
cmd := exec.Command("kubectl", "port-forward", "svc/mydb-frontend", "4002:4002")
Expand Down
Loading