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: correctly find workspace.dependencies-declared dependencies and their Cargo.toml #5865

Conversation

poliorcetics
Copy link
Contributor

I would like help for writing a test, I have found cargo/file_fetcher_spec.rb, but I don't
understand how it works.

Closes #5864

@poliorcetics poliorcetics requested a review from a team as a code owner October 10, 2022 14:03
@poliorcetics poliorcetics force-pushed the 5864-fix-rust-cargo-workspace-dep-discovery branch 2 times, most recently from 556b218 to 38435a0 Compare October 10, 2022 14:20
@jakecoffman
Copy link
Member

I happened to have just created one in #5866, you can use it as an example.

The fixture is the response from api.github.com for a Cargo.toml. So for instance https://api.github.com/repos/tokio-rs/bytes/contents/Cargo.toml would be a valid fixture. The content field is the base64 encoded contents of the file.

In your test it will need to assert the array matches all the various Cargo.toml paths it should download.

@poliorcetics
Copy link
Contributor Author

I will two need Cargo.toml at least from a public repo with the problem then ?

@jurre
Copy link
Member

jurre commented Oct 10, 2022

I will two need Cargo.toml at least from a public repo with the problem then ?

You can also bas64 encode the contents of a cargo.toml that you have locally and stick it in the fixtures manually. We stub out any requests to the github api with those fixtures, so they don't need to exist for real

@jeffwidman
Copy link
Member

@poliorcetics Anything else we can do to unblock you here?

@jeffwidman
Copy link
Member

gentle nudge @poliorcetics

@jeffwidman
Copy link
Member

Checking in one last time @poliorcetics are you still interested in working on this?

@poliorcetics
Copy link
Contributor Author

Sorry I completely forgot to answer before, I don't think I can finish this.

For someone wanting to make it cross the finish line: the only thing left to do are tests

@jeffwidman jeffwidman force-pushed the 5864-fix-rust-cargo-workspace-dep-discovery branch from 38435a0 to f796a03 Compare January 10, 2023 20:00
@jeffwidman
Copy link
Member

Let me see if I can read up on cargo a little and put something together...

@poliorcetics poliorcetics force-pushed the 5864-fix-rust-cargo-workspace-dep-discovery branch from f796a03 to 3991e88 Compare June 13, 2023 20:31
@github-actions github-actions bot added the L: rust:cargo Rust crates via cargo label Jun 13, 2023
@jeffwidman
Copy link
Member

jeffwidman commented Jul 25, 2023

@poliorcetics I did spend some time on this back in January, and ran into some issues with creating mocks of test code in Rust. The code seems straightforward, but the UT I'd added kept failing--the ruby looked fine, so I think I was misunderstanding something about how the rust cargo files should look. Which is probably on me, as your example in #5864 makes sense.

Any chance you'd want to take another shot at writing a test, or at the very least push up an example repo or mock to help clarify?

@Nishnha Nishnha merged commit 5bb693d into dependabot:main Jul 27, 2023
82 of 83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: rust:cargo Rust crates via cargo
Projects
Archived in project
5 participants