-
Notifications
You must be signed in to change notification settings - Fork 24
/
SkipperServerMigrationTests.java
128 lines (113 loc) · 6.58 KB
/
SkipperServerMigrationTests.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
* Copyright 2018-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.dataflow.acceptance.tests;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.cloud.dataflow.acceptance.core.DockerCompose;
import org.springframework.cloud.dataflow.acceptance.core.DockerComposeExtension;
import org.springframework.cloud.dataflow.acceptance.core.DockerComposeInfo;
import org.springframework.cloud.dataflow.acceptance.tests.support.Db2;
import org.springframework.cloud.dataflow.acceptance.tests.support.Migration;
import org.springframework.cloud.dataflow.acceptance.tests.support.MsSql;
import org.springframework.cloud.dataflow.acceptance.tests.support.Mysql_5_6;
import org.springframework.cloud.dataflow.acceptance.tests.support.Mysql_5_7;
import org.springframework.cloud.dataflow.acceptance.tests.support.Mysql_8_0;
import org.springframework.cloud.dataflow.acceptance.tests.support.Oracle;
import org.springframework.cloud.dataflow.acceptance.tests.support.Postgres;
import org.springframework.cloud.dataflow.acceptance.tests.support.SkipperAll;
/**
* Tests going through start of skipper servers with databases and verifying
* that newer versions work when older versions have created initial db schemas.
*
* @author Janne Valkealahti
*
*/
@ExtendWith(DockerComposeExtension.class)
@Migration
public class SkipperServerMigrationTests extends AbstractDataflowTests {
// postgres
@Test
@Postgres
@SkipperAll
@DockerCompose(id = "db", order = 0, locations = { "src/test/resources/db/postgres.yml" }, services = { "postgres" })
@DockerCompose(id = "skipper11x", order = 1, locations = { "src/test/resources/skipper/skipper11xpostgres.yml" }, services = { "skipper" }, log = "skipper11x/")
@DockerCompose(id = "skipper20x", order = 1, locations = { "src/test/resources/skipper/skipper20xpostgres.yml" }, services = { "skipper" }, start = false, log = "skipper20x/")
public void testMigrationFrom11xToLatestWithPostgres(DockerComposeInfo dockerComposeInfo) throws Exception {
migrationAsserts(dockerComposeInfo);
}
// mysql
@Test
@Mysql_5_6
@SkipperAll
@DockerCompose(id = "db", order = 0, locations = { "src/test/resources/db/mysql_5_6.yml" }, services = { "mysql" })
@DockerCompose(id = "skipper11x", order = 1, locations = { "src/test/resources/skipper/skipper11xmysql.yml" }, services = { "skipper" }, log = "skipper11x/")
@DockerCompose(id = "skipper20x", order = 1, locations = { "src/test/resources/skipper/skipper20xmysql.yml" }, services = { "skipper" }, start = false, log = "skipper20x/")
public void testMigrationFrom11xToLatestWithMysql56(DockerComposeInfo dockerComposeInfo) throws Exception {
migrationAsserts(dockerComposeInfo);
}
@Test
@Mysql_5_7
@SkipperAll
@DockerCompose(id = "db", order = 0, locations = { "src/test/resources/db/mysql_5_7.yml" }, services = { "mysql" })
@DockerCompose(id = "skipper11x", order = 1, locations = { "src/test/resources/skipper/skipper11xmysql.yml" }, services = { "skipper" }, log = "skipper11x/")
@DockerCompose(id = "skipper20x", order = 1, locations = { "src/test/resources/skipper/skipper20xmysql.yml" }, services = { "skipper" }, start = false, log = "skipper20x/")
public void testMigrationFrom11xToLatestWithMysql57(DockerComposeInfo dockerComposeInfo) throws Exception {
migrationAsserts(dockerComposeInfo);
}
@Test
@Mysql_8_0
@SkipperAll
@DockerCompose(id = "db", order = 0, locations = { "src/test/resources/db/mysql_8_0.yml" }, services = { "mysql" })
@DockerCompose(id = "skipper11x", order = 1, locations = { "src/test/resources/skipper/skipper11xmysqlwithmysqldriver.yml" }, services = { "skipper" }, log = "skipper11x/")
@DockerCompose(id = "skipper20x", order = 1, locations = { "src/test/resources/skipper/skipper20xmysqlwithmysqldriver.yml" }, services = { "skipper" }, start = false, log = "skipper20x/")
public void testMigrationFrom11xToLatestWithMysql80(DockerComposeInfo dockerComposeInfo) throws Exception {
migrationAsserts(dockerComposeInfo);
}
// oracle
@Test
@Oracle
@SkipperAll
@DockerCompose(id = "db", order = 0, locations = { "src/test/resources/db/oracle.yml" }, services = { "oracle" })
@DockerCompose(id = "skipper11x", order = 1, locations = { "src/test/resources/skipper/skipper11xoracle.yml" }, services = { "skipper" }, log = "skipper11x/")
@DockerCompose(id = "skipper20x", order = 1, locations = { "src/test/resources/skipper/skipper20xoracle.yml" }, services = { "skipper" }, start = false, log = "skipper20x/")
public void testMigrationFrom11xToLatestWithOracle(DockerComposeInfo dockerComposeInfo) throws Exception {
migrationAsserts(dockerComposeInfo);
}
// mssql
@Test
@MsSql
@SkipperAll
@DockerCompose(id = "db", order = 0, locations = { "src/test/resources/db/mssql.yml" }, services = { "mssql" })
@DockerCompose(id = "skipper11x", order = 1, locations = { "src/test/resources/skipper/skipper11xmssql.yml" }, services = { "skipper" }, log = "skipper11x/")
@DockerCompose(id = "skipper20x", order = 1, locations = { "src/test/resources/skipper/skipper20xmssql.yml" }, services = { "skipper" }, start = false, log = "skipper20x/")
public void testMigrationFrom11xToLatestWithMsSql(DockerComposeInfo dockerComposeInfo) throws Exception {
migrationAsserts(dockerComposeInfo);
}
// db2
@Test
@Db2
@SkipperAll
@DockerCompose(id = "db", order = 0, locations = { "src/test/resources/db/db2.yml" }, services = { "db2" })
@DockerCompose(id = "skipper11x", order = 1, locations = { "src/test/resources/skipper/skipper11xdb2.yml" }, services = { "skipper" }, log = "skipper11x/")
@DockerCompose(id = "skipper20x", order = 1, locations = { "src/test/resources/skipper/skipper20xdb2.yml" }, services = { "skipper" }, start = false, log = "skipper20x/")
public void testMigrationFrom11xToLatestWithDb2(DockerComposeInfo dockerComposeInfo) throws Exception {
migrationAsserts(dockerComposeInfo);
}
private void migrationAsserts(DockerComposeInfo dockerComposeInfo) {
assertSkipperServerRunning(dockerComposeInfo, "skipper11x", "skipper");
upgradeSkipper(dockerComposeInfo, "skipper11x", "skipper20x", "skipper");
}
}