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

Fix cli tests in windows #774

Merged
merged 3 commits into from
Oct 17, 2022
Merged

Fix cli tests in windows #774

merged 3 commits into from
Oct 17, 2022

Conversation

ahtrotta
Copy link
Contributor

@ahtrotta ahtrotta commented Oct 10, 2022

Fixes getappmap/board#188

@ahtrotta ahtrotta force-pushed the fix-cli-tests-in-windows branch from 054087a to 46be2c4 Compare October 10, 2022 20:11
@ahtrotta ahtrotta marked this pull request as ready for review October 10, 2022 20:57
@ahtrotta ahtrotta requested a review from dividedmind October 12, 2022 14:57
Copy link
Collaborator

@dividedmind dividedmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I had some questions, and some stylistic suggestions but you're free to take them or leave them.

The only thing I'm particularly (not too much though) concerned about is the prettier change. I'd rather we don't see crlf in the repository one day ;)

If the tests are fixed, can we change travis configuration to run the full CLI test suite on Windows now?

@ahtrotta ahtrotta force-pushed the fix-cli-tests-in-windows branch 2 times, most recently from c142efa to 3dad381 Compare October 12, 2022 23:19
@ahtrotta
Copy link
Contributor Author

Thanks for the excellent review! I addressed all of your comments. Let me know if you have any other questions or concerns.

I made it so all of the tests except for one run in Windows on Travis.

@@ -0,0 +1,17 @@
const FILTERED_TESTS = process.platform === 'win32' ? ['fingerprintWatchCommand'] : [];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this test need to be filtered? If there's something left to fix for this issue, that's fine, but please remember to create another one to keep track of the loose end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one gives this error in Travis on Windows:

image

You can see it in the logs on this build: https://app.travis-ci.com/github/getappmap/appmap-js/jobs/585469980#L220

I'll make a new issue for it.

@dividedmind
Copy link
Collaborator

dividedmind commented Oct 13, 2022

Thanks for the excellent review! I addressed all of your comments. Let me know if you have any other questions or concerns.

I made it so all of the tests except for one run in Windows on Travis.

Thanks, that looks much better! Now I'm only worried about those line endings. Perhaps it would be a good idea to add a gitattributes per-file eol override for the affected expectation files to prevent git from breaking the tests. (It'd probably look like

packages/cli/tests/unit/fixtures/encodedFile/**/* eol=lf
packages/cli/tests/unit/fixtures/encodedFile/windows/* eol=crlf

— haven't checked if it actually works, YMMV. Another option would be to do -text for all these files so git leaves them alone.)

@ahtrotta ahtrotta force-pushed the fix-cli-tests-in-windows branch from 15ca190 to 28636c6 Compare October 13, 2022 21:54
@ahtrotta
Copy link
Contributor Author

ahtrotta commented Oct 13, 2022

I put all of the tests into the platform-specific describe blocks in encodedFile.spec.ts, and all of the tests except for one are passing.

The strange thing is that this test passes for me locally on Windows and on Linux, so I'm not sure how to debug this. I tried changing the .travis.yml file, but it didn't do anything.

Do you have any thoughts?

@ahtrotta ahtrotta force-pushed the fix-cli-tests-in-windows branch 2 times, most recently from 67e3f3e to 95a03da Compare October 14, 2022 21:08
@ahtrotta
Copy link
Contributor Author

Okay, I got it to work. Turns out that forcing CRLF in the Windows files using:

/packages/cli/tests/unit/fixtures/encodedFile/windows/**/* eol=crlf

was causing issues on Travis. I'm not sure why. But I needed to force LF for the Unix test files for it to work on Windows.

Let me know if there's anything else you think needs to be changed!

@ahtrotta ahtrotta requested a review from dividedmind October 14, 2022 22:38
Copy link
Collaborator

@dividedmind dividedmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great now, thanks for figuring out this pesky EOL business!

(Please remember to rebase and fixup everything before merging.)

@ahtrotta ahtrotta force-pushed the fix-cli-tests-in-windows branch 2 times, most recently from c626172 to 2e9d82e Compare October 17, 2022 13:07
@ahtrotta ahtrotta force-pushed the fix-cli-tests-in-windows branch from 2e9d82e to cf2baee Compare October 17, 2022 13:37
@ahtrotta ahtrotta merged commit 77dc7bc into main Oct 17, 2022
@ahtrotta ahtrotta deleted the fix-cli-tests-in-windows branch October 17, 2022 15:20
@appland-release
Copy link
Contributor

🎉 This PR is included in version @appland/appmap-v3.45.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants