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

Publish test crates #13418

Merged
merged 9 commits into from
Mar 26, 2024
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ cargo-credential-libsecret = { version = "0.4.2", path = "credential/cargo-crede
cargo-credential-macos-keychain = { version = "0.4.2", path = "credential/cargo-credential-macos-keychain" }
cargo-credential-wincred = { version = "0.4.2", path = "credential/cargo-credential-wincred" }
cargo-platform = { path = "crates/cargo-platform", version = "0.1.5" }
cargo-test-macro = { path = "crates/cargo-test-macro" }
cargo-test-support = { path = "crates/cargo-test-support" }
cargo-test-macro = { version = "0.2.0", path = "crates/cargo-test-macro" }
cargo-test-support = { version = "0.2.0", path = "crates/cargo-test-support" }
cargo-util = { version = "0.2.9", path = "crates/cargo-util" }
cargo-util-schemas = { version = "0.3.0", path = "crates/cargo-util-schemas" }
cargo_metadata = "0.18.1"
Expand Down
5 changes: 2 additions & 3 deletions crates/cargo-test-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[package]
name = "cargo-test-macro"
version = "0.1.0"
version = "0.2.0"
edition.workspace = true
rust-version = "1.77" # MSRV:1
license.workspace = true
homepage.workspace = true
repository.workspace = true
documentation = "https://github.com/rust-lang/cargo"
description = "Helper proc-macro for Cargo's testsuite."
publish = false

[lib]
proc-macro = true
Expand Down
1 change: 1 addition & 0 deletions crates/cargo-test-macro/LICENSE-APACHE
1 change: 1 addition & 0 deletions crates/cargo-test-macro/LICENSE-MIT
5 changes: 5 additions & 0 deletions crates/cargo-test-macro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
WARNING: You might not want to use this outside of Cargo.

* This is designed for testing Cargo itself. Use at your own risk.
* No guarantee on any stability across versions.
* No feature request would be accepted unless proved useful for testing Cargo.
11 changes: 11 additions & 0 deletions crates/cargo-test-macro/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
//! # Cargo test macro.
//!
//! This is meant to be consumed alongside `cargo-test-support`. See
//! <https://rust-lang.github.io/cargo/contrib/> for a guide on writing tests.
//!
//! WARNING: You might not want to use this outside of Cargo.
//!
//! * This is designed for testing Cargo itself. Use at your own risk.
//! * No guarantee on any stability across versions.
//! * No feature request would be accepted unless proved useful for testing Cargo.

use proc_macro::*;
use std::path::Path;
use std::process::Command;
Expand Down
9 changes: 6 additions & 3 deletions crates/cargo-test-support/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[package]
name = "cargo-test-support"
version = "0.1.0"
license.workspace = true
version = "0.2.0"
edition.workspace = true
publish = false
rust-version = "1.77" # MSRV:1
license.workspace = true
homepage.workspace = true
repository.workspace = true
description = "Testing framework for Cargo's testsuite."

[lib]
doctest = false
Expand Down
1 change: 1 addition & 0 deletions crates/cargo-test-support/LICENSE-APACHE
1 change: 1 addition & 0 deletions crates/cargo-test-support/LICENSE-MIT
5 changes: 5 additions & 0 deletions crates/cargo-test-support/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
WARNING: You might not want to use this outside of Cargo.

* This is designed for testing Cargo itself. Use at your own risk.
* No guarantee on any stability across versions.
* No feature request would be accepted unless proved useful for testing Cargo.
6 changes: 6 additions & 0 deletions crates/cargo-test-support/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
//! # Cargo test support.
//!
//! See <https://rust-lang.github.io/cargo/contrib/> for a guide on writing tests.
//!
//! WARNING: You might not want to use this outside of Cargo.
//!
//! * This is designed for testing Cargo itself. Use at your own risk.
//! * No guarantee on any stability across versions.
//! * No feature request would be accepted unless proved useful for testing Cargo.

#![allow(clippy::disallowed_methods)]
#![allow(clippy::print_stderr)]
Expand Down
4 changes: 4 additions & 0 deletions crates/xtask-bump-check/src/xtask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ fn bump_check(args: &clap::ArgMatches, gctx: &cargo::util::GlobalContext) -> Car
let mut cmd = ProcessBuilder::new("cargo");
cmd.arg("semver-checks")
.arg("check-release")
.args(&["--exclude", "cargo-test-macro"]) // FIXME: Remove once 1.79 is stable.
.args(&["--exclude", "cargo-test-support"]) // FIXME: Remove once 1.79 is stable.
.arg("--workspace");
gctx.shell().status("Running", &cmd)?;
cmd.exec()?;
Expand All @@ -176,6 +178,8 @@ fn bump_check(args: &clap::ArgMatches, gctx: &cargo::util::GlobalContext) -> Car
let mut cmd = ProcessBuilder::new("cargo");
cmd.arg("semver-checks")
.arg("--workspace")
.args(&["--exclude", "cargo-test-macro"]) // FIXME: Remove once 1.79 is stable.
.args(&["--exclude", "cargo-test-support"]) // FIXME: Remove once 1.79 is stable.
.arg("--baseline-rev")
.arg(referenced_commit.id().to_string());
for krate in crates_not_check_against_channels {
Expand Down
2 changes: 2 additions & 0 deletions publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
'crates/cargo-util',
'crates/crates-io',
'crates/cargo-util-schemas',
'crates/cargo-test-macro',
'crates/cargo-test-support',
'.',
]

Expand Down
6 changes: 3 additions & 3 deletions src/doc/contrib/src/process/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ Cargo's library and its related dependencies (like `cargo-util`) are published
to [crates.io] as part of the 6-week stable release process by the [Release
team]. There is a [`publish.py` script] that is used by the Release team's
automation scripts (see <https://github.com/rust-lang/simpleinfra/>) to handle
determining which packages to publish. The test and build tool crates aren't
published. This runs on the specific git commit associated with the cargo
submodule in the `stable` branch in `rust-lang/rust` at the time of release.
determining which packages to publish. The build tool crates aren't published.
This runs on the specific git commit associated with the cargo submodule in the
`stable` branch in `rust-lang/rust` at the time of release.

On very rare cases, the Cargo team may decide to manually publish a new
release to [crates.io]. For example, this may be necessary if there is a
Expand Down