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

ci: run rust-tests on windows #92

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

crrow
Copy link

@crrow crrow commented Jul 24, 2024

Description

Use cargo-binstall to install tarpaulin.

#90

How are the changes test-covered

  • N/A
  • Automated tests (unit and/or integration tests)
  • Manual tests
    • Details are described below

@crrow crrow force-pushed the feat/run-ci-on-windows branch 2 times, most recently from 340f06b to 13d4ca9 Compare July 24, 2024 15:56
@crrow crrow changed the title Feat/run ci on windows chore: run ci on windows Jul 24, 2024
@github-actions github-actions bot added the ci label Jul 24, 2024
@xushiyan xushiyan added this to the release-0.2.0 milestone Jul 25, 2024
@xushiyan xushiyan changed the title chore: run ci on windows ci: run rust-tests on windows Jul 25, 2024
Copy link
Member

@xushiyan xushiyan left a comment

Choose a reason for hiding this comment

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

Screenshot 2024-07-24 at 9 35 50 PM

@crrow thanks for the fix! interestingly the CI job wasn't even triggered. any idea what's going on?

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@xushiyan
Copy link
Member

@crrow i suspect your previous approach using binstall could work but the github action was not whitelisted by asf so the whole workflow is not triggered. if you can verify that binstall approach in your own fork and get CI to pass, then i can reach out to have that white listed.

@crrow
Copy link
Author

crrow commented Jul 27, 2024

@crrow i suspect your previous approach using binstall could work but the github action was not whitelisted by asf so the whole workflow is not triggered. if you can verify that binstall approach in your own fork and get CI to pass, then i can reach out to have that white listed.

ok, i'll check it out later.

@crrow crrow force-pushed the feat/run-ci-on-windows branch from 6300fc3 to 0b991e3 Compare July 27, 2024 09:31
@crrow
Copy link
Author

crrow commented Jul 27, 2024

@crrow i suspect your previous approach using binstall could work but the github action was not whitelisted by asf so the whole workflow is not triggered. if you can verify that binstall approach in your own fork and get CI to pass, then i can reach out to have that white listed.

ok, i'll check it out later.

Hello @xushiyan , I setup the workflow, have a check when you are free.

https://github.com/crrow/hudi-rs/actions/runs/10122608881/job/27994952767

steps:
- uses: actions/checkout@v4
- uses: cargo-bins/cargo-binstall@main
- name: Install tarpaulin
run: cargo binstall -y cargo-tarpaulin
Copy link
Member

Choose a reason for hiding this comment

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

@crrow using cargo-bins/cargo-binstall works! The job fails due to some test failure - can you look into and fix any code if needed? meanwhile i'll get binstall whitelist so it can be triggered here.

Copy link
Author

Choose a reason for hiding this comment

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

@xushiyan I'd love to, but I'd prefer to address the Windows code in a separate pull request.

Copy link
Author

Choose a reason for hiding this comment

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

What's your thought on separator and test case? Some test failed because of rust's automatic normalize, and URL parse failed since some test cases are Linux path, and it cannot be parsed on Windows.

By the way, I think some test cases can be rewritten with https://crates.io/crates/test-case

Copy link
Member

Choose a reason for hiding this comment

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

@crrow absolutely! we should separate test code fix from CI setup change. Feel free to create another PR for the test fix wrt url parsing. You may also make the code change here so we know the test fix can pass with the CI, then separate it out. It's up to you.

I've thought about using some test helper lib but not sure if https://github.com/frondeus/test-case is the best candidate. there are many crates maintained by community like https://github.com/la10736/rstest seems more popular with more recent releases. I'll create an issue about this for future refactoring work.

Copy link
Author

Choose a reason for hiding this comment

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

@xushiyan Do we have to handle this case? , its tricky for windows

Copy link
Member

Choose a reason for hiding this comment

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

@xushiyan Do we have to handle this case? , its tricky for windows

@crrow that path is a unix path which should not be applicable to windows os. Can we split that case to test case which does not run on windows, and also add a windows specific test case with an example windows path ?

Copy link
Author

Choose a reason for hiding this comment

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

Sure, I'd love to

Copy link
Author

Choose a reason for hiding this comment

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

Oh...I found that its still tricky, like "C:\foo", url::parse will success, it thoughts 'c' is the schema, rather than a filepath; for "\foo", url::parse and url::from_filepath will all fail; We can handle both cases by adding additional check like if current os is windows and the given str has ":\".

Can we be stricter about what qualifies as a 'valid URL'? Like a valid URL must have a schema.

Copy link
Member

Choose a reason for hiding this comment

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

@crrow would you do a bit of research on how windows paths are usually handled in consideration of scheme? we want to be flexible in supporting paths - it can start with C:\, file:///, /, s3:// as these are valid paths anyway.

@xushiyan xushiyan modified the milestones: release-0.2.0, release-0.3.0 Sep 15, 2024
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.

2 participants