@@ -13,11 +13,10 @@ import (
13
13
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/option"
14
14
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/registry"
15
15
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test"
16
- "github.com/cockroachdb/cockroach/pkg/roachprod/config"
17
16
"github.com/cockroachdb/cockroach/pkg/roachprod/install"
18
17
)
19
18
20
- var supportedLiquibaseHarnessCommit = "1790ddef2d0339c5c96839ac60ac424c130dadd8 "
19
+ var supportedLiquibaseHarnessCommit = "f43b967d60aa4ce7056a6d6ee0bc6d9f144c62d5 "
21
20
22
21
// This test runs the Liquibase test harness against a single cockroach node.
23
22
func registerLiquibase (r registry.Registry ) {
@@ -32,7 +31,8 @@ func registerLiquibase(r registry.Registry) {
32
31
node := c .Node (1 )
33
32
t .Status ("setting up cockroach" )
34
33
startOpts := option .DefaultStartOpts ()
35
- startOpts .RoachprodOpts .SQLPort = config .DefaultSQLPort
34
+ // The liquibase-test-harness expects CockroachDB to be on port 26263.
35
+ startOpts .RoachprodOpts .SQLPort = 26263
36
36
// TODO(darrylwong): if https://github.com/liquibase/liquibase-test-harness/pull/724 is merged, enable secure mode
37
37
c .Start (ctx , t .L (), startOpts , install .MakeClusterSettings (install .SecureOption (false )), c .All ())
38
38
@@ -58,14 +58,13 @@ func registerLiquibase(r registry.Registry) {
58
58
t .Fatal (err )
59
59
}
60
60
61
- // TODO(rafi): use openjdk-11-jdk-headless once we are off of Ubuntu 16.
62
61
if err := repeatRunE (
63
62
ctx ,
64
63
t ,
65
64
c ,
66
65
node ,
67
66
"install dependencies" ,
68
- `sudo apt-get -qq install default-jre openjdk-8 -jdk-headless maven` ,
67
+ `sudo apt-get -qq install default-jre openjdk-17 -jdk-headless maven` ,
69
68
); err != nil {
70
69
t .Fatal (err )
71
70
}
@@ -77,8 +76,8 @@ func registerLiquibase(r registry.Registry) {
77
76
t .Fatal (err )
78
77
}
79
78
80
- // TODO(richardjcai ): When liquibase-test-harness 1.0.3 is released and tagged,
81
- // use the tag version instead of the commit.
79
+ // TODO(sql-foundations ): When liquibase-test-harness 1.0.12 is released and
80
+ // tagged, use the tag version instead of the commit.
82
81
if err = c .RunE (ctx , option .WithNodes (node ), "cd /mnt/data1/ && git clone https://github.com/liquibase/liquibase-test-harness.git" ); err != nil {
83
82
t .Fatal (err )
84
83
}
@@ -95,7 +94,11 @@ func registerLiquibase(r registry.Registry) {
95
94
t .Fatal (err )
96
95
}
97
96
// TODO(darrylwong): once secure mode is enabled, add --certs-dir=install.CockroachNodeCertsDir
98
- if err = c .RunE (ctx , option .WithNodes (node ), `/mnt/data1/liquibase-test-harness/src/test/resources/docker/setup_db.sh localhost` ); err != nil {
97
+ if err = c .RunE (
98
+ ctx ,
99
+ option .WithNodes (node ),
100
+ fmt .Sprintf (`/mnt/data1/liquibase-test-harness/src/test/resources/docker/setup_db.sh localhost:%d` , startOpts .RoachprodOpts .SQLPort ),
101
+ ); err != nil {
99
102
t .Fatal (err )
100
103
}
101
104
@@ -106,21 +109,40 @@ func registerLiquibase(r registry.Registry) {
106
109
107
110
const (
108
111
repoDir = "/mnt/data1/liquibase-test-harness"
109
- resultsPath = repoDir + "/target/surefire-reports/TEST-liquibase.harness.LiquibaseHarnessSuiteTest.xml "
112
+ resultsPath = repoDir + "/target/surefire-reports/"
110
113
)
111
114
115
+ // The Liquibase test harness currently has fixtures for 23.1, 23.2,
116
+ // and 24.1. We use the 24.1 here since its the most recent one.
112
117
// TODO(darrylwong): once secure mode is enabled, add -DdbUsername=roach -DdbPassword=system
113
118
cmd := fmt .Sprintf ("cd /mnt/data1/liquibase-test-harness/ && " +
114
119
"mvn surefire-report:report-only test -Dtest=LiquibaseHarnessSuiteTest " +
115
- "-DdbName=cockroachdb -DdbVersion=20.2 -DoutputDirectory=%s" , repoDir )
120
+ "-DdbName=cockroachdb -DdbVersion=24.1 -DoutputDirectory=%s" , repoDir )
116
121
117
122
err = c .RunE (ctx , option .WithNodes (node ), cmd )
118
123
if err != nil {
119
124
t .L ().Printf ("error whilst running tests (may be expected): %#v" , err )
120
125
}
121
126
127
+ // Load the list of all test results files and parse them individually.
128
+ result , err := repeatRunWithDetailsSingleNode (
129
+ ctx ,
130
+ c ,
131
+ t ,
132
+ node ,
133
+ "get list of test files" ,
134
+ `ls ` + resultsPath + `*.xml` ,
135
+ )
136
+ if err != nil {
137
+ t .Fatal (err )
138
+ }
139
+
140
+ if len (result .Stdout ) == 0 {
141
+ t .Fatal ("could not find any test result files" )
142
+ }
143
+
122
144
parseAndSummarizeJavaORMTestsResults (
123
- ctx , t , c , node , "liquibase" /* ormName */ , []byte (resultsPath ),
145
+ ctx , t , c , node , "liquibase" /* ormName */ , []byte (result . Stdout ),
124
146
blocklistName ,
125
147
expectedFailures ,
126
148
ignoreList ,
0 commit comments