Repository: GoogleCloudPlatform/pgadapter
Pull request #1278 (2023-12-17 19:05:55)

build: do not fail PR if codecov upload fails
Codecov upload fails regularly. This should stop this from failing the PR.


Patch:
diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml
index 681b6196..4e223c7a 100644
--- a/.github/workflows/integration.yaml
+++ b/.github/workflows/integration.yaml
@@ -123,7 +123,7 @@ jobs:
         uses: codecov/codecov-action@v3
         with:
           directory: ./target/site/jacoco-merged-test-coverage-report
-          fail_ci_if_error: true
+          fail_ci_if_error: false
           flags: all_tests
           name: codecov-umbrella
           path_to_write_report: ./coverage/codecov_report.txt
diff --git a/benchmarks/ycsb/Dockerfile b/benchmarks/ycsb/Dockerfile
index 6833f3de..43bcf5f5 100644
--- a/benchmarks/ycsb/Dockerfile
+++ b/benchmarks/ycsb/Dockerfile
@@ -18,7 +18,9 @@ RUN mvn package -Passembly -DskipTests
 
 
 # Docker image for the YCSB runner.
-FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:slim
+# We pin the version to 455.0.0, because YCSB requires Python 2.x, and this is the last
+# version of the gcloud-cli Docker image that supports Python 2.x.
+FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:455.0.0-slim
 
 RUN apt update && apt -y install postgresql-client
 RUN apt -y install default-jre
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java
index 6f87e64f..fc64aeab 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java
@@ -383,7 +383,7 @@ class DdlExecutor {
     }
   }
 
-  private static final class Table implements Comparable<Table> {
+  static final class Table implements Comparable<Table> {
     private final String schema;
     private final String name;
     private final String parent;


Test patch:
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutorTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutorTest.java
index 75399ceb..3fb05b16 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutorTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutorTest.java
@@ -26,6 +26,7 @@ import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.connection.AbstractStatementParser;
 import com.google.cloud.spanner.connection.AbstractStatementParser.ParsedStatement;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
+import com.google.cloud.spanner.pgadapter.statements.DdlExecutor.Table;
 import com.google.cloud.spanner.pgadapter.statements.SimpleParser.TableOrIndexName;
 import com.google.cloud.spanner.pgadapter.utils.RegexQueryPartReplacer;
 import com.google.common.base.Suppliers;
@@ -256,6 +257,12 @@ public class DdlExecutorTest {
             "create table databasechangelog_replaced (id bigint primary key)"));
   }
 
+  @Test
+  public void testTableComparison() {
+    assertEquals(1, new Table("public", "foo", "bar").compareTo(new Table("public", "baz", "foo")));
+    assertEquals(-1, new Table("public", "foo", "bar").compareTo(new Table("public", "bar", null)));
+  }
+
   private String applyReplacers(DdlExecutor ddlExecutor, String sql) {
     Statement statement = Statement.of(sql);
     ParsedStatement parsedStatement = PARSER.parse(Statement.of(sql));