From bda910ccf5a5f2ee4bc0c92b5b710754b8229fe0 Mon Sep 17 00:00:00 2001 From: King-Hin Leung <35692276+leungkinghin@users.noreply.github.com> Date: Fri, 28 May 2021 15:14:27 +0200 Subject: [PATCH] Fix flaky build (#288) * Enable unstable integration test case * Change to java 1.8 * Change to java 1.8 * Revert "Change to java 1.8" This reverts commit 60f3a37babee9f336ada119b0011a3600e5360ac. * Revert "Change to java 1.8" This reverts commit a9de7b18541042b8cf60b15c58de0e5fb150d032. * Fix spotless check * Fix spotless check * Remove Caffeine artifact * Change version number to 4.0.2 * Remove Caffeine version number --- README.md | 34 +++++++++---------- build.gradle | 6 +--- .../InventoryEntrySyncerTest.java | 2 -- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index b37ff480..944674bd 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ Example: ##### Download ```bash -docker pull commercetools/commercetools-project-sync:4.0.1 +docker pull commercetools/commercetools-project-sync:4.0.2 ``` ##### Run @@ -209,14 +209,14 @@ docker run \ -e TARGET_PROJECT_KEY=xxxx \ -e TARGET_CLIENT_ID=xxxx \ -e TARGET_CLIENT_SECRET=xxxx \ -commercetools/commercetools-project-sync:4.0.1 -s all +commercetools/commercetools-project-sync:4.0.2 -s all ``` ### Examples - To run the all sync modules from a source project to a target project ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s all + docker run commercetools/commercetools-project-sync:4.0.2 -s all ``` This will run the following sync modules in the given order: 1. `Type` Sync and `ProductType` Sync and `States` Sync and `TaxCategory` Sync and `CustomObject` Sync in parallel. @@ -226,68 +226,68 @@ commercetools/commercetools-project-sync:4.0.1 -s all - To run the type sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s types + docker run commercetools/commercetools-project-sync:4.0.2 -s types ``` - To run the productType sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s productTypes + docker run commercetools/commercetools-project-sync:4.0.2 -s productTypes ``` - To run the states sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s states + docker run commercetools/commercetools-project-sync:4.0.2 -s states ``` - To run the taxCategory sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s taxCategories + docker run commercetools/commercetools-project-sync:4.0.2 -s taxCategories ``` - To run the category sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s categories + docker run commercetools/commercetools-project-sync:4.0.2 -s categories ``` - To run the product sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s products + docker run commercetools/commercetools-project-sync:4.0.2 -s products ``` - To run the cartDiscount sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s cartDiscounts + docker run commercetools/commercetools-project-sync:4.0.2 -s cartDiscounts ``` - To run the inventoryEntry sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s inventoryEntries + docker run commercetools/commercetools-project-sync:4.0.2 -s inventoryEntries ``` - To run the customObject sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s customObjects + docker run commercetools/commercetools-project-sync:4.0.2 -s customObjects ``` - To run the customer sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s customers + docker run commercetools/commercetools-project-sync:4.0.2 -s customers ``` - To run the shoppingList sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s shoppingLists + docker run commercetools/commercetools-project-sync:4.0.2 -s shoppingLists ``` - To run both products and shoppingList sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s products shoppingLists + docker run commercetools/commercetools-project-sync:4.0.2 -s products shoppingLists ``` - To run type, productType and shoppingList sync ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s types productTypes shoppingLists + docker run commercetools/commercetools-project-sync:4.0.2 -s types productTypes shoppingLists ``` - To run all sync modules using a runner name ```bash - docker run commercetools/commercetools-project-sync:4.0.1 -s all -r myRunnerName + docker run commercetools/commercetools-project-sync:4.0.2 -s all -r myRunnerName ``` diff --git a/build.gradle b/build.gradle index f58116ac..85211748 100644 --- a/build.gradle +++ b/build.gradle @@ -38,14 +38,11 @@ ext { commercetoolsSyncJava='5.1.1' apacheCliVersion = '1.4' jupiterApiVersion = '5.7.2' - caffeineVersion = '3.0.2' asyncHttpClientVersion = '2.12.3' logbackVersion = '1.2.3' logstashLogbackEncoderVersion= '6.6' } - - apply from: "$rootDir/gradle-scripts/spotless.gradle" apply from: "$rootDir/gradle-scripts/pmd.gradle" apply from: "$rootDir/gradle-scripts/jacoco.gradle" @@ -79,9 +76,8 @@ dependencies { implementation "ch.qos.logback:logback-classic:${logbackVersion}" implementation "ch.qos.logback:logback-core:${logbackVersion}" implementation "net.logstash.logback:logstash-logback-encoder:${logstashLogbackEncoderVersion}" - implementation "com.google.code.findbugs:annotations:${findbugsVersion}" - implementation "com.github.ben-manes.caffeine:caffeine:${caffeineVersion}" + constraints { implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.12.3") { because "previous versions are vulnerable to DoS" diff --git a/src/test/java/com/commercetools/project/sync/inventoryentry/InventoryEntrySyncerTest.java b/src/test/java/com/commercetools/project/sync/inventoryentry/InventoryEntrySyncerTest.java index c9c50797..f7419fec 100644 --- a/src/test/java/com/commercetools/project/sync/inventoryentry/InventoryEntrySyncerTest.java +++ b/src/test/java/com/commercetools/project/sync/inventoryentry/InventoryEntrySyncerTest.java @@ -28,7 +28,6 @@ import java.util.concurrent.CompletionStage; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import uk.org.lidalia.slf4jtest.LoggingEvent; import uk.org.lidalia.slf4jtest.TestLogger; @@ -111,7 +110,6 @@ void transform_ShouldReplaceInventoryEntryReferenceIdsWithKeys() { assertThat(draftsFromPageStage).isCompletedWithValue(expectedResult); } - @Disabled @Test void syncWithError_ShouldCallErrorCallback() { final TestLogger syncerTestLogger = TestLoggerFactory.getTestLogger(InventoryEntrySyncer.class);