Skip to content

Commit

Permalink
Add tests which indicate the problem: safety-bump not applied to auto…
Browse files Browse the repository at this point in the history
…-publishes… (#221)

…which isn't testing that safety-bumped crates in dependencies are
always released as well.
  • Loading branch information
Byron committed Oct 16, 2021
1 parent 1b6a4ad commit 32e1f1a
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cargo-smart-release/tests/journey.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ title "smart-release"
WITH_SNAPSHOT="$snapshot/a-dry-run-success-multi-crate-auto-bump-breaking-change" \
expect_run $SUCCESSFULLY "$exe" smart-release a --no-push --no-publish -v --allow-dirty --allow-fully-generated-changelogs
}
(with "unconditional version bumping"
it "succeeds" && {
WITH_SNAPSHOT="$snapshot/a-dry-run-success-multi-crate-auto-bump-breaking-change-no-bump-on-demand" \
expect_run $SUCCESSFULLY "$exe" smart-release a --no-push --no-publish -v --allow-dirty --allow-fully-generated-changelogs --no-bump-on-demand
}
)
(when 'releasing "c" as well with unconditional version bumping'
it "succeeds" && {
WITH_SNAPSHOT="$snapshot/a-dry-run-success-multi-crate-auto-bump-breaking-change-dependant-publish" \
expect_run $SUCCESSFULLY "$exe" smart-release c a --no-push --no-publish -v --allow-dirty --allow-fully-generated-changelogs --no-bump-on-demand
}
)
git reset --hard HEAD~1 &>/dev/null
)
(with "a new feature"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[WARN ] Crates.io index doesn't exist. Consider using --update-crates-index to help determining if release versions are published already
[INFO ] Package 'a' wasn't tagged with a-v0.8.0 yet and thus needs a release
[INFO ] Adding 'a' v0.8.0 to set of published crates as it changed since last release
[INFO ] Package 'b' wasn't tagged with b-v0.8.0 yet and thus needs a release
[INFO ] Adding 'b' v0.8.0 to set of published crates as it changed since last release
[INFO ] Auto-bumped 'a' minor version to 0.9.0 from 0.8.0 to signal breaking changes.
[INFO ] Congratulations for the new release of 'a' 🎉
[INFO ] Auto-bumped 'b' patch version to 0.8.1 from 0.8.0.
[INFO ] Congratulations for the new release of 'b' 🎉
[INFO ] Auto-bumped 'c' patch version to 8.0.1 from 8.0.0.
[INFO ] Congratulations for the new release of 'c' 🎉
[INFO ] WOULD modify existing changelog for 'a'.
[INFO ] WOULD modify existing changelog for 'b'.
[INFO ] WOULD create a new changelog for 'c'.
[INFO ] Pending 'a' manifest version update: "0.9.0"
[INFO ] Pending 'b' manifest version update: "0.8.1"
[INFO ] Pending 'b' manifest dependencies update: 'a = "^0.9.0"' (from "0.8.0" )
[INFO ] Pending 'c' manifest version update: "8.0.1"
[INFO ] Pending 'c' conservative manifest dependencies update: 'b = "^0.8.1"' (from "0.8.0" )
[INFO ] WOULD persist changes to 3 manifests and 3 changelogs (1 new) with: "Adjusting changelogs prior to release of a v0.9.0, b v0.8.1, c v8.0.1"
[INFO ] Up to 3 changelogs would be previewed if the --execute is set and --no-changelog-preview is unset.
[WARN ] WOULD ask for review after commit as the changelog entry is empty for crates: b, c
[WARN ] To fix the changelog manually, run: cargo changelog --write --only b
[WARN ] To fix the changelog manually, run: cargo changelog --write --only c
[WARN ] This changelog is likely to be fully generated from commit history or contain lower-case git-conventional headlines: a
[INFO ] WOULD run "git" "commit" "-am" "Adjusting changelogs prior to release of a v0.9.0, b v0.8.1, c v8.0.1"
[INFO ] WOULD prepare releases of a v0.9.0, b v0.8.1, c v8.0.1
[INFO ] WOULD create tag object a-v0.9.0 with changelog message, first line is: '### refactor (BREAKING)'
[INFO ] WOULD create tag object b-v0.8.1 with changelog message, first line is: '### Commit Statistics'
[INFO ] WOULD create tag object c-v8.0.1 with changelog message, first line is: '### Commit Statistics'
[INFO ] WOULD run "gh" "release" "create" "a-v0.9.0" "--title" "a v0.9.0" "--notes" "### refactor (B…" [note truncated]
[INFO ] WOULD run "gh" "release" "create" "b-v0.8.1" "--title" "b v0.8.1" "--notes" "### Commit Stat…" [note truncated]
[INFO ] WOULD run "gh" "release" "create" "c-v8.0.1" "--title" "c v8.0.1" "--notes" "### Commit Stat…" [note truncated]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[WARN ] Crates.io index doesn't exist. Consider using --update-crates-index to help determining if release versions are published already
[INFO ] Package 'a' wasn't tagged with a-v0.8.0 yet and thus needs a release
[INFO ] Auto-bumped 'a' minor version to 0.9.0 from 0.8.0 to signal breaking changes.
[INFO ] Congratulations for the new release of 'a' 🎉
[INFO ] WOULD modify existing changelog for 'a'.
[INFO ] Pending 'a' manifest version update: "0.9.0"
[INFO ] Pending 'b' manifest version update: "0.9.0"
[INFO ] Pending 'b' manifest dependencies update: 'a = "^0.9.0"' (from "0.8.0" )
[INFO ] Pending 'c' manifest version update: "8.1.0"
[INFO ] Pending 'c' manifest dependencies update: 'b = "^0.9.0"' (from "0.8.0" )
[INFO ] WOULD persist changes to 3 manifests and 1 changelogs with: "Adjusting changelogs prior to release of a v0.9.0, safety bump 2 crates\n\nSAFETY BUMP: b v0.9.0, c v8.1.0"
[INFO ] Up to 1 changelog would be previewed if the --execute is set and --no-changelog-preview is unset.
[WARN ] This changelog is likely to be fully generated from commit history or contain lower-case git-conventional headlines: a
[INFO ] WOULD run "git" "commit" "-am" "Adjusting changelogs prior to release of a v0.9.0, safety bump 2 crates\n\nSAFETY BUMP: b v0.9.0, c v8.1.0"
[INFO ] WOULD prepare releases of a v0.9.0, bumping 2 crates for safety
[INFO ] WOULD create tag object a-v0.9.0 with changelog message, first line is: '### refactor (BREAKING)'
[INFO ] WOULD run "gh" "release" "create" "a-v0.9.0" "--title" "a v0.9.0" "--notes" "### refactor (B…" [note truncated]

0 comments on commit 32e1f1a

Please sign in to comment.