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

Improve testing framework for http registries #10738

Merged
merged 1 commit into from
Jun 11, 2022

Conversation

arlosi
Copy link
Contributor

@arlosi arlosi commented Jun 8, 2022

Improve integration of the http server introduced by the http-registry feature.

The same HTTP server is used for serving downloads, the index, and the API within the test framework.

This makes it easier to write tests that deal with authentication and http registries.

Most of this change is pulled from #10592. Getting it in separately should make the other change easier to review.

r? @Eh2406

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 8, 2022
@Eh2406
Copy link
Contributor

Eh2406 commented Jun 8, 2022

I like it. @ehuss want to look it over before we +1?

@arlosi arlosi force-pushed the auth-testingonly branch from 977d983 to 2300ef5 Compare June 9, 2022 03:10
tests/testsuite/publish.rs Show resolved Hide resolved
tests/testsuite/credential_process.rs Outdated Show resolved Hide resolved
@arlosi arlosi force-pushed the auth-testingonly branch 2 times, most recently from 19790e9 to 6941c3b Compare June 9, 2022 23:37
Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

Should we bump a version for cargo-util? I can see that these new field and method are only used by cargo-test-support though.

crates/cargo-util/src/process_builder.rs Outdated Show resolved Hide resolved
@arlosi arlosi force-pushed the auth-testingonly branch 2 times, most recently from 84c1d1c to f286a4f Compare June 10, 2022 19:58
@arlosi arlosi force-pushed the auth-testingonly branch from f286a4f to b5d0a86 Compare June 10, 2022 21:51
Improve integration of the http server introduced by the http-registry feature.
Now the same HTTP server is used for serving downloads, the index, and
the API.

This makes it easier to write tests that deal with authentication and
http registries.
@arlosi arlosi force-pushed the auth-testingonly branch from b5d0a86 to 24dac45 Compare June 10, 2022 21:52
@ehuss
Copy link
Contributor

ehuss commented Jun 11, 2022

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 11, 2022

📌 Commit 24dac45 has been approved by ehuss

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 11, 2022
@bors
Copy link
Contributor

bors commented Jun 11, 2022

⌛ Testing commit 24dac45 with merge 6b8e192...

@bors
Copy link
Contributor

bors commented Jun 11, 2022

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 6b8e192 to master...

@bors bors merged commit 6b8e192 into rust-lang:master Jun 11, 2022
arlosi added a commit to arlosi/rust that referenced this pull request Jun 17, 2022
4 commits in 4d92f07f34ba7fb7d7f207564942508f46c225d3..8d42b0e8794ce3787c9f7d6d88b02ae80ebe8d19
2022-06-10 01:11:04 +0000 to 2022-06-17 16:46:26 +0000
- Use specific terminology for sparse HTTP-based registry (rust-lang/cargo#10764)
- chore: Upgrade to clap 3.2 (rust-lang/cargo#10753)
- Improve testing framework for http registries (rust-lang/cargo#10738)
- doc: Improve example of using the links field (rust-lang/cargo#10728)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 18, 2022
Update cargo

4 commits in 4d92f07f34ba7fb7d7f207564942508f46c225d3..8d42b0e8794ce3787c9f7d6d88b02ae80ebe8d19
2022-06-10 01:11:04 +0000 to 2022-06-17 16:46:26 +0000
- Use specific terminology for sparse HTTP-based registry (rust-lang/cargo#10764)
- chore: Upgrade to clap 3.2 (rust-lang/cargo#10753)
- Improve testing framework for http registries (rust-lang/cargo#10738)
- doc: Improve example of using the links field (rust-lang/cargo#10728)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 18, 2022
Update cargo

4 commits in 4d92f07f34ba7fb7d7f207564942508f46c225d3..8d42b0e8794ce3787c9f7d6d88b02ae80ebe8d19
2022-06-10 01:11:04 +0000 to 2022-06-17 16:46:26 +0000
- Use specific terminology for sparse HTTP-based registry (rust-lang/cargo#10764)
- chore: Upgrade to clap 3.2 (rust-lang/cargo#10753)
- Improve testing framework for http registries (rust-lang/cargo#10738)
- doc: Improve example of using the links field (rust-lang/cargo#10728)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 18, 2022
Update cargo

4 commits in 4d92f07f34ba7fb7d7f207564942508f46c225d3..8d42b0e8794ce3787c9f7d6d88b02ae80ebe8d19
2022-06-10 01:11:04 +0000 to 2022-06-17 16:46:26 +0000
- Use specific terminology for sparse HTTP-based registry (rust-lang/cargo#10764)
- chore: Upgrade to clap 3.2 (rust-lang/cargo#10753)
- Improve testing framework for http registries (rust-lang/cargo#10738)
- doc: Improve example of using the links field (rust-lang/cargo#10728)
@ehuss ehuss added this to the 1.63.0 milestone Jun 22, 2022
bors added a commit that referenced this pull request Oct 12, 2022
Fix deadlock when build scripts are waiting for input on stdin

### What does this PR try to resolve?

#10738 introduced a regression where build scripts did not close stdin, causing deadlocks for build scripts waiting for stdin.

Fixes #11196 by not piping `stdin` unless requested by the `ProcessBuilder`.

### How should we test and review this PR?

Run a build script that reads from stdin and check that it no longer hangs. See the POC in the linked issue. The included test hangs without the fix.

r? `@ehuss`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants