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

Closed
1 task done
rohanKanojia opened this issue Oct 20, 2024 · 1 comment · Fixed by #3500
Closed
1 task done

FileSecretIT is failing on windows #3478

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

Comments

@rohanKanojia
Copy link
Member

rohanKanojia commented Oct 20, 2024

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?

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.

3 participants