From 489aacf4650939eb6463432d185c9b4827bba4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Mu=C3=B1oz?= Date: Wed, 4 Mar 2026 11:10:20 +0100 Subject: [PATCH] Fixes to make "make sdk-test" to run standalone --- Makefile | 2 +- destination/main_e2e_test.go | 6 +++--- ...nfiguration.json => default_configuration.json.txt} | 0 sdk_tests/input_hard_truncate_before.json | 10 +++++----- sdk_tests/input_soft_truncate_before.json | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) rename sdk_tests/{default_configuration.json => default_configuration.json.txt} (100%) diff --git a/Makefile b/Makefile index 0835347..c9664ef 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ lint: docker run --rm -v $$PWD:/destination -w /destination golangci/golangci-lint:$(GOLANG_CI_LINT_VERSION) golangci-lint run -v test: - test -f sdk_tests/configuration.json || cp sdk_tests/default_configuration.json sdk_tests/configuration.json + test -f sdk_tests/configuration.json || cp sdk_tests/default_configuration.json.txt sdk_tests/configuration.json go test fivetran.com/fivetran_sdk/destination/... -count=1 -v -race $$TEST_ARGS test-with-coverage: diff --git a/destination/main_e2e_test.go b/destination/main_e2e_test.go index d42d342..27e021e 100644 --- a/destination/main_e2e_test.go +++ b/destination/main_e2e_test.go @@ -210,7 +210,7 @@ func TestNonExistentRecordUpdatesAndDeletes(t *testing.T) { func TestSoftTruncateBefore(t *testing.T) { fileName := "input_soft_truncate_before.json" - tableName := "table_to_truncate" + tableName := "table_to_soft_truncate" startServer(t) runSDKTestCommand(t, fileName, true) assertTableRowsWithPK(t, tableName, [][]string{ @@ -226,7 +226,7 @@ func TestSoftTruncateBefore(t *testing.T) { func TestHardTruncateBefore(t *testing.T) { fileName := "input_hard_truncate_before.json" - tableName := "table_to_truncate" + tableName := "table_to_hard_truncate" startServer(t) runSDKTestCommand(t, fileName, true) assertTableRowsWithPK(t, tableName, [][]string{ @@ -524,7 +524,7 @@ func readConfigMap(t *testing.T) map[string]string { rootDir := getProjectRootDir(t) configBytes, err := os.ReadFile(fmt.Sprintf("%s/sdk_tests/configuration.json", rootDir)) require.NoError(t, err, - "copy the default configuration first: cp sdk_tests/default_configuration.json sdk_tests/configuration.json") + "copy the default configuration first: cp sdk_tests/default_configuration.json.txt sdk_tests/configuration.json") m := make(map[string]string) err = json.Unmarshal(configBytes, &m) require.NoError(t, err) diff --git a/sdk_tests/default_configuration.json b/sdk_tests/default_configuration.json.txt similarity index 100% rename from sdk_tests/default_configuration.json rename to sdk_tests/default_configuration.json.txt diff --git a/sdk_tests/input_hard_truncate_before.json b/sdk_tests/input_hard_truncate_before.json index 0bfb0b6..ad42d80 100644 --- a/sdk_tests/input_hard_truncate_before.json +++ b/sdk_tests/input_hard_truncate_before.json @@ -1,6 +1,6 @@ { "create_table": { - "table_to_truncate": { + "table_to_hard_truncate": { "columns": { "id": "INT", "name": "STRING" @@ -11,12 +11,12 @@ } }, "describe_table": [ - "table_to_truncate" + "table_to_hard_truncate" ], "ops": [ { "upsert": { - "table_to_truncate": [ + "table_to_hard_truncate": [ { "id": 1, "name": "foo" @@ -26,12 +26,12 @@ }, { "truncate_before": [ - "table_to_truncate" + "table_to_hard_truncate" ] }, { "upsert": { - "table_to_truncate": [ + "table_to_hard_truncate": [ { "id": 2, "name": "bar" diff --git a/sdk_tests/input_soft_truncate_before.json b/sdk_tests/input_soft_truncate_before.json index 7634c9d..6d6793a 100644 --- a/sdk_tests/input_soft_truncate_before.json +++ b/sdk_tests/input_soft_truncate_before.json @@ -1,6 +1,6 @@ { "create_table": { - "table_to_truncate": { + "table_to_soft_truncate": { "columns": { "id": "INT", "name": "STRING" @@ -11,12 +11,12 @@ } }, "describe_table": [ - "table_to_truncate" + "table_to_soft_truncate" ], "ops": [ { "upsert": { - "table_to_truncate": [ + "table_to_soft_truncate": [ { "id": 1, "name": "foo" @@ -26,12 +26,12 @@ }, { "soft_truncate_before": [ - "table_to_truncate" + "table_to_soft_truncate" ] }, { "upsert": { - "table_to_truncate": [ + "table_to_soft_truncate": [ { "id": 2, "name": "bar"