@@ -13,11 +13,10 @@ import (
1313 "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/option"
1414 "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/registry"
1515 "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test"
16- "github.com/cockroachdb/cockroach/pkg/roachprod/config"
1716 "github.com/cockroachdb/cockroach/pkg/roachprod/install"
1817)
1918
20- var supportedLiquibaseHarnessCommit = "1790ddef2d0339c5c96839ac60ac424c130dadd8 "
19+ var supportedLiquibaseHarnessCommit = "f43b967d60aa4ce7056a6d6ee0bc6d9f144c62d5 "
2120
2221// This test runs the Liquibase test harness against a single cockroach node.
2322func registerLiquibase (r registry.Registry ) {
@@ -32,7 +31,8 @@ func registerLiquibase(r registry.Registry) {
3231 node := c .Node (1 )
3332 t .Status ("setting up cockroach" )
3433 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
3636 // TODO(darrylwong): if https://github.com/liquibase/liquibase-test-harness/pull/724 is merged, enable secure mode
3737 c .Start (ctx , t .L (), startOpts , install .MakeClusterSettings (install .SecureOption (false )), c .All ())
3838
@@ -58,14 +58,13 @@ func registerLiquibase(r registry.Registry) {
5858 t .Fatal (err )
5959 }
6060
61- // TODO(rafi): use openjdk-11-jdk-headless once we are off of Ubuntu 16.
6261 if err := repeatRunE (
6362 ctx ,
6463 t ,
6564 c ,
6665 node ,
6766 "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` ,
6968 ); err != nil {
7069 t .Fatal (err )
7170 }
@@ -77,8 +76,8 @@ func registerLiquibase(r registry.Registry) {
7776 t .Fatal (err )
7877 }
7978
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.
8281 if err = c .RunE (ctx , option .WithNodes (node ), "cd /mnt/data1/ && git clone https://github.com/liquibase/liquibase-test-harness.git" ); err != nil {
8382 t .Fatal (err )
8483 }
@@ -95,7 +94,11 @@ func registerLiquibase(r registry.Registry) {
9594 t .Fatal (err )
9695 }
9796 // 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 {
99102 t .Fatal (err )
100103 }
101104
@@ -106,21 +109,40 @@ func registerLiquibase(r registry.Registry) {
106109
107110 const (
108111 repoDir = "/mnt/data1/liquibase-test-harness"
109- resultsPath = repoDir + "/target/surefire-reports/TEST-liquibase.harness.LiquibaseHarnessSuiteTest.xml "
112+ resultsPath = repoDir + "/target/surefire-reports/"
110113 )
111114
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.
112117 // TODO(darrylwong): once secure mode is enabled, add -DdbUsername=roach -DdbPassword=system
113118 cmd := fmt .Sprintf ("cd /mnt/data1/liquibase-test-harness/ && " +
114119 "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 )
116121
117122 err = c .RunE (ctx , option .WithNodes (node ), cmd )
118123 if err != nil {
119124 t .L ().Printf ("error whilst running tests (may be expected): %#v" , err )
120125 }
121126
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+
122144 parseAndSummarizeJavaORMTestsResults (
123- ctx , t , c , node , "liquibase" /* ormName */ , []byte (resultsPath ),
145+ ctx , t , c , node , "liquibase" /* ormName */ , []byte (result . Stdout ),
124146 blocklistName ,
125147 expectedFailures ,
126148 ignoreList ,
0 commit comments