From 6ae285244a459a389da10b02f903e4dbaa80ea74 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Tue, 13 May 2025 16:29:43 +0200 Subject: [PATCH 1/4] Always use line feed for newlines in acceptance tests --- .codegen.json | 3 ++- .gitattributes | 1 + .../selftest/record_cloud/workspace-file-io/test.toml | 7 +------ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.codegen.json b/.codegen.json index 54c108218f..4bb8e4e980 100644 --- a/.codegen.json +++ b/.codegen.json @@ -25,7 +25,8 @@ "make schema", "echo 'bundle/internal/tf/schema/\\*.go linguist-generated=true' >> ./.gitattributes", "echo 'go.sum linguist-generated=true' >> ./.gitattributes", - "echo 'bundle/schema/jsonschema.json linguist-generated=true' >> ./.gitattributes" + "echo 'bundle/schema/jsonschema.json linguist-generated=true' >> ./.gitattributes", + "echo 'acceptance/** eol=lf' >> ./.gitattributes" ] } } diff --git a/.gitattributes b/.gitattributes index 8c01d8d74a..5c95291c10 100755 --- a/.gitattributes +++ b/.gitattributes @@ -142,3 +142,4 @@ cmd/workspace/workspace/workspace.go linguist-generated=true bundle/internal/tf/schema/\*.go linguist-generated=true go.sum linguist-generated=true bundle/schema/jsonschema.json linguist-generated=true +acceptance/** eol=lf diff --git a/acceptance/selftest/record_cloud/workspace-file-io/test.toml b/acceptance/selftest/record_cloud/workspace-file-io/test.toml index fa35335247..2df14096e4 100644 --- a/acceptance/selftest/record_cloud/workspace-file-io/test.toml +++ b/acceptance/selftest/record_cloud/workspace-file-io/test.toml @@ -1,9 +1,4 @@ -# hello, world\n base64 encoded in unix +# hello, world\n base64 encoded [[Repls]] Old = "aGVsbG8sIHdvcmxkCg==" New = "[HELLO-WORLD]" - -# hello, world\n base64 encoded in windows -[[Repls]] -Old = "aGVsbG8sIHdvcmxkDQo=" -New = "[HELLO-WORLD]" From a9231172e5fdb63727ab00abc69de77463b16b1e Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Tue, 13 May 2025 17:28:31 +0200 Subject: [PATCH 2/4] - --- .codegen.json | 1 - .gitattributes | 1 - acceptance/.gitattributes | 5 +++++ 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 acceptance/.gitattributes diff --git a/.codegen.json b/.codegen.json index 4bb8e4e980..7f26c12f6b 100644 --- a/.codegen.json +++ b/.codegen.json @@ -26,7 +26,6 @@ "echo 'bundle/internal/tf/schema/\\*.go linguist-generated=true' >> ./.gitattributes", "echo 'go.sum linguist-generated=true' >> ./.gitattributes", "echo 'bundle/schema/jsonschema.json linguist-generated=true' >> ./.gitattributes", - "echo 'acceptance/** eol=lf' >> ./.gitattributes" ] } } diff --git a/.gitattributes b/.gitattributes index 5c95291c10..8c01d8d74a 100755 --- a/.gitattributes +++ b/.gitattributes @@ -142,4 +142,3 @@ cmd/workspace/workspace/workspace.go linguist-generated=true bundle/internal/tf/schema/\*.go linguist-generated=true go.sum linguist-generated=true bundle/schema/jsonschema.json linguist-generated=true -acceptance/** eol=lf diff --git a/acceptance/.gitattributes b/acceptance/.gitattributes new file mode 100644 index 0000000000..6de2df7c5d --- /dev/null +++ b/acceptance/.gitattributes @@ -0,0 +1,5 @@ +# We should always treat new lines in acceptance tests in windows as \n. +# This is important because the characters itself can be semantically important in tests. +# For example, an additional \r character in windows changes the upload payload if you are +# uploading the file's content to a workspace. +* text eol=lf From e741e754675d5b1e7a385399cee8f025497e8d7a Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Tue, 13 May 2025 17:28:56 +0200 Subject: [PATCH 3/4] - --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 7f26c12f6b..54c108218f 100644 --- a/.codegen.json +++ b/.codegen.json @@ -25,7 +25,7 @@ "make schema", "echo 'bundle/internal/tf/schema/\\*.go linguist-generated=true' >> ./.gitattributes", "echo 'go.sum linguist-generated=true' >> ./.gitattributes", - "echo 'bundle/schema/jsonschema.json linguist-generated=true' >> ./.gitattributes", + "echo 'bundle/schema/jsonschema.json linguist-generated=true' >> ./.gitattributes" ] } } From a2039fe3eee56a6a1648d0147e6021f50c7974ea Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Fri, 16 May 2025 13:48:02 +0200 Subject: [PATCH 4/4] address comemnts --- acceptance/.gitattributes | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acceptance/.gitattributes b/acceptance/.gitattributes index 6de2df7c5d..8cec723714 100644 --- a/acceptance/.gitattributes +++ b/acceptance/.gitattributes @@ -1,5 +1,5 @@ -# We should always treat new lines in acceptance tests in windows as \n. +# We should always treat new lines in text files acceptance tests in windows as \n. # This is important because the characters itself can be semantically important in tests. # For example, an additional \r character in windows changes the upload payload if you are # uploading the file's content to a workspace. -* text eol=lf +*.txt text eol=lf