-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat: Add upm target #209
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
feat: Add upm target #209
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a724ed9
feat(publish): Add UPM target
bitsandfoxes 6bc9106
fix blunder with getRemoteString()
BYK c3bb0a5
fix typo
BYK 5bc7bc0
fix getting target revision
BYK 476053d
fix create release command repo args
BYK dbc3bef
added tests
bitsandfoxes 0a6bbb5
ref: Lint fixes
getsentry-bot 58f57ec
make basic tests work
BYK f204d34
DRY up artifacts tests
BYK 0907aba
refine tests a bit more
BYK 5f441b8
refine tests even more, add a sample publish test
BYK e798444
Fix typo
BYK 6309344
Better error message when artifact count becomes an issue
BYK 7c06be8
Dry-run flag readability
BYK 15b9ba3
update docstrings
BYK d80a380
s/releaseOwner/releaseRepoOwner
BYK ee69e03
better function docstring
BYK ad59592
add better error message when target commit is empty
BYK 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
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,66 @@ | ||
| import { NoneArtifactProvider } from '../../artifact_providers/none'; | ||
| import { UpmTarget } from '../upm'; | ||
|
|
||
| describe('UPM Target', () => { | ||
| const cleanEnv = { ...process.env }; | ||
| let upmTarget: UpmTarget; | ||
|
|
||
| beforeEach(() => { | ||
| process.env = { | ||
| ...cleanEnv, | ||
| GITHUB_TOKEN: 'ghp_TAN21WJQkLtYVdHCh5eQJ8hTWoYvNh47gGWH', | ||
| DRY_RUN: 'false', | ||
| }; | ||
| jest.resetAllMocks(); | ||
|
|
||
| upmTarget = new UpmTarget( | ||
| { | ||
| name: 'upm-test', | ||
| releaseRepoOwner: 'getsentry-test', | ||
| releaseRepoName: 'unity-test', | ||
| }, | ||
| new NoneArtifactProvider(), | ||
| { owner: 'testSourceOwner', repo: 'testSourceRepo' } | ||
| ); | ||
| }); | ||
|
|
||
| describe('artifacts', () => { | ||
| beforeEach(() => { | ||
| process.env.DRY_RUN = 'false'; | ||
| }); | ||
| test.each` | ||
| artifacts | error | ||
| ${[]} | ${'Cannot publish UPM: No release artifact found.'} | ||
| ${['file1', 'file2']} | ${'Cannot publish UPM: Too many release artifacts found:\nfile1\nfile2'} | ||
| `( | ||
| 'error with artifact count $artifacts.length', | ||
| async ({ artifacts, error }) => { | ||
| upmTarget.getArtifactsForRevision = jest | ||
| .fn() | ||
| .mockResolvedValueOnce(artifacts); | ||
|
|
||
| await expect(upmTarget.fetchArtifact('revision')).rejects.toThrow( | ||
| error | ||
| ); | ||
| } | ||
| ); | ||
| }); | ||
|
|
||
| // TODO(byk): Add more tests for this | ||
| describe.skip('publish', () => { | ||
| beforeEach(() => { | ||
| upmTarget.fetchArtifact = jest | ||
| .fn() | ||
| .mockResolvedValueOnce({ filename: 'artifact.zip' }); | ||
| upmTarget.artifactProvider.downloadArtifact = jest | ||
| .fn() | ||
| .mockResolvedValueOnce('some/test/path'); | ||
| }); | ||
|
|
||
| test('publish', () => { | ||
| return expect( | ||
| upmTarget.publish('version', 'revision') | ||
| ).resolves.not.toThrow(); | ||
| }); | ||
| }); | ||
| }); | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.