-
Notifications
You must be signed in to change notification settings - Fork 134
A test for mismatching checked out git tag when publishing #1329
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
test-fixtures/publish/1109-tag-mismatch/expected-stderr.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| Reading Spago workspace configuration... | ||
|
|
||
| ✓ Selecting package to build: aaa | ||
|
|
||
| Downloading dependencies... | ||
| Building... | ||
| Src Lib All | ||
| Warnings 0 0 0 | ||
| Errors 0 0 0 | ||
|
|
||
| ✓ Build succeeded. | ||
|
|
||
| Your package "aaa" is not ready for publishing yet, encountered 1 error: | ||
|
|
||
|
|
||
| ✘ The tag (v0.0.1) does not match the expected tag (v0.0.2). | ||
| Fix all other publishing-related errors first before creating the correct tag. Do not push your created tag to its remote. Prematurely creating and pushing a tag can lead to unpublishable tags. | ||
| To create the tag, you can run: | ||
| git tag v0.0.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package: | ||
| name: aaa | ||
| dependencies: [] | ||
| publish: | ||
| version: 0.0.2 | ||
| license: MIT | ||
| location: | ||
| githubOwner: purescript | ||
| githubRepo: aaa | ||
| workspace: | ||
| packageSet: | ||
| registry: 58.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| module Lib where | ||
|
|
||
| anExport :: String | ||
| anExport = "Hello, World!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| module Test.Spago.Transfer (spec) where | ||
|
|
||
| import Test.Prelude | ||
|
|
||
| import Spago.FS as FS | ||
| import Spago.Path as Path | ||
| import Test.Spago.Publish (doTheGitThing) | ||
| import Test.Spec (Spec) | ||
| import Test.Spec as Spec | ||
|
|
||
| spec :: Spec Unit | ||
| spec = Spec.around withTempDir do | ||
| Spec.describe "transfer" do | ||
|
|
||
| Spec.it "fails if the publish config is not specified" \{ spago, fixture } -> do | ||
| spago [ "init", "--name", "aaaa" ] >>= shouldBeSuccess | ||
| spago [ "registry", "transfer", "--offline", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeFailureErr (fixture "publish/transfer/no-publish-config.txt") | ||
|
|
||
| Spec.it "fails if the config does not specify an owner" \{ spago, fixture, testCwd } -> do | ||
| FS.copyFile { src: fixture "publish/basic.yaml", dst: testCwd </> "spago.yaml" } | ||
| spago [ "build" ] >>= shouldBeSuccess | ||
| spago [ "registry", "transfer", "--offline", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeFailureErr (fixture "publish/transfer/no-owner.txt") | ||
|
|
||
| Spec.it "fails if the git tree is not clean" \{ spago, fixture, testCwd } -> do | ||
| FS.copyFile { src: fixture "publish/basic.yaml", dst: testCwd </> "spago.yaml" } | ||
| spago [ "auth", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeSuccess | ||
| spago [ "registry", "transfer", "--offline", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeFailureErr (fixture "publish/transfer/no-git.txt") | ||
|
|
||
| Spec.it "fails if the package has never been published before" \{ spago, fixture, testCwd } -> do | ||
| FS.copyFile { src: fixture "publish/basic.yaml", dst: testCwd </> "spago.yaml" } | ||
| spago [ "auth", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeSuccess | ||
| doTheGitThing | ||
| spago [ "registry", "transfer", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeFailureErr (fixture "publish/transfer/never-published.txt") | ||
|
|
||
| Spec.it "fails if the new repo location is the same as the current one in the registry" \{ spago, fixture, testCwd } -> do | ||
| FS.copyFile { src: fixture "publish/transfer/aff.yaml", dst: testCwd </> "spago.yaml" } | ||
| spago [ "auth", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeSuccess | ||
| doTheGitThing | ||
| spago [ "registry", "transfer", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeFailureErr (fixture "publish/transfer/same-location.txt") | ||
|
|
||
| Spec.it "fails if can't find the private key" \{ spago, fixture, testCwd } -> do | ||
| FS.copyFile { src: fixture "publish/transfer/aff-new-location.yaml", dst: testCwd </> "spago.yaml" } | ||
| spago [ "auth", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeSuccess | ||
| doTheGitThing | ||
| spago [ "registry", "transfer", "-i", (Path.toRaw $ fixture "publish/no-key") ] >>= shouldBeFailureErr (fixture "publish/transfer/no-key.txt") | ||
|
|
||
| Spec.it "fails if running with --offline" \{ spago, fixture, testCwd } -> do | ||
| FS.copyFile { src: fixture "publish/transfer/aff-new-location.yaml", dst: testCwd </> "spago.yaml" } | ||
| spago [ "auth", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeSuccess | ||
| doTheGitThing | ||
| spago [ "registry", "transfer", "--offline", "-i", (Path.toRaw $ fixture "publish/key") ] >>= shouldBeFailureErr (fixture "publish/transfer/offline.txt") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub doesn't show this diff in its most sensical way. The
transfersection has been moved out toTransfer.pursand two tests right after it were indented one level to bring them back underpublish.This diff is best viewed with whitespace ignored.