Skip to content

Commit

Permalink
test(bump): more skip-ci tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ABWassim authored and oknozor committed Mar 8, 2024
1 parent 12df7a2 commit 1c478ed
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/cog_tests/bump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,28 @@ fn bump_monorepo_with_default_skip_ci_ok() -> Result<()> {
Ok(())
}

#[sealed_test]
fn bump_monorepo_manual_increment_with_default_skip_ci_ok() -> Result<()> {
let mut settings = Settings {
..Default::default()
};
init_monorepo(&mut settings)?;

Command::cargo_bin("cog")?
.arg("bump")
.arg("--minor")
.arg("--skip-ci")
.assert()
.success();

let commit_message = git_log_head_message()?;

assert_tag_exists("0.1.0")?;
assert!(commit_message.contains("[skip ci]"));

Ok(())
}

#[sealed_test]
fn bump_monorepo_with_cog_toml_defined_skip_ci_ok() -> Result<()> {
let mut settings = Settings {
Expand Down Expand Up @@ -649,6 +671,30 @@ fn bump_monorepo_skip_ci_override_option_takes_precedence() -> Result<()> {
Ok(())
}

#[sealed_test]
fn bump_only_package_with_default_skip_ci_ok() -> Result<()> {
let mut settings = Settings {
generate_mono_repository_global_tag: false,
..Default::default()
};
init_monorepo(&mut settings)?;

Command::cargo_bin("cog")?
.arg("bump")
.arg("--auto")
.arg("--skip-ci")
.assert()
.success();

let commit_message = git_log_head_message()?;

assert_tag_does_not_exist("0.1.0")?;
assert_tag_exists("one-0.1.0")?;
assert!(commit_message.contains("[skip ci]"));

Ok(())
}

#[sealed_test]
fn disable_commit_creation_with_config_standard_ok() -> Result<()> {
git_init()?;
Expand Down

0 comments on commit 1c478ed

Please sign in to comment.