Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileSecretIT is failing on windows #3478

Open
1 task
rohanKanojia opened this issue Oct 20, 2024 · 1 comment · May be fixed by #3500
Open
1 task

FileSecretIT is failing on windows #3478

rohanKanojia opened this issue Oct 20, 2024 · 1 comment · May be fixed by #3500
Assignees
Labels
help wanted Extra attention is needed

Comments

@rohanKanojia
Copy link
Member

Component

None

Task description

Description

Related to #3406

⚠️ A windows machine is required to reproduce and fix problems in this issue

FileSecretIT is failing on windows:

Error:    FileSecretIT.k8sResource_whenRun_generatesK8sSecret:35 � IllegalArgument Values not equal for entry: 'application.properties', expected 'a2V5MSA9IHZhbHVlMQprZXkyID0gdmFsdWUyCmtleTMgPSB2YWx1ZTM=' but was 'a2V5MSA9IHZhbHVlMQ0Ka2V5MiA9IHZhbHVlMg0Ka2V5MyA9IHZhbHVlMw=='
Error:    FileSecretIT.ocResource_whenRun_generatesK8sSecret:48 � IllegalArgument Values not equal for entry: 'application.properties', expected 'a2V5MSA9IHZhbHVlMQprZXkyID0gdmFsdWUyCmtleTMgPSB2YWx1ZTM=' but was 'a2V5MSA9IHZhbHVlMQ0Ka2V5MiA9IHZhbHVlMg0Ka2V5MyA9IHZhbHVlMw=='

This issue looks related to one issue I had fixed #3014

Problem seems to be here :

private byte[] readContent(String location) throws IOException {
return Files.readAllBytes(Paths.get(location));
}

Jackson generates annotation with platform specific line delimiters /r/n for windows.

If we change it like this, it makes test pass:

-        return Files.readAllBytes(Paths.get(location));
+        String data = new String(Files.readAllBytes(Paths.get(location)));
+        data = data.replaceAll("\r?\n", "\n");
+        return data.getBytes();

Expected Behavior

FileSecretIT should pass on windows

Acceptance Criteria

  • FileSecretIT should pass on windows and Linux
@pujakarakoti07
Copy link
Contributor

pujakarakoti07 commented Oct 21, 2024

@rohanKanojia I want to work on this issue, can you please assign this to me?

@pujakarakoti07 pujakarakoti07 linked a pull request Oct 30, 2024 that will close this issue
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants