-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nuget): add support for updating lock files (#7375)
- Loading branch information
1 parent
87f73dc
commit d37111c
Showing
6 changed files
with
634 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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,204 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`updateArtifacts aborts if lock file is unchanged 1`] = ` | ||
Array [ | ||
Object { | ||
"cmd": "dotnet restore project.csproj --force-evaluate", | ||
"options": Object { | ||
"cwd": "/tmp/github/some/repo", | ||
"encoding": "utf-8", | ||
"env": Object { | ||
"HOME": "/home/user", | ||
"HTTPS_PROXY": "https://example.com", | ||
"HTTP_PROXY": "http://example.com", | ||
"LANG": "en_US.UTF-8", | ||
"LC_ALL": "en_US", | ||
"NO_PROXY": "localhost", | ||
"PATH": "/tmp/path", | ||
}, | ||
"maxBuffer": 10485760, | ||
"timeout": 900000, | ||
}, | ||
}, | ||
] | ||
`; | ||
|
||
exports[`updateArtifacts aborts if no lock file found 1`] = `Array []`; | ||
|
||
exports[`updateArtifacts authenticates at registries 1`] = ` | ||
Array [ | ||
Object { | ||
"cmd": "dotnet nuget update source myRegistry --username some-username --password some-password --store-password-in-clear-text", | ||
"options": Object { | ||
"cwd": "/tmp/github/some/repo", | ||
"encoding": "utf-8", | ||
"env": Object { | ||
"HOME": "/home/user", | ||
"HTTPS_PROXY": "https://example.com", | ||
"HTTP_PROXY": "http://example.com", | ||
"LANG": "en_US.UTF-8", | ||
"LC_ALL": "en_US", | ||
"NO_PROXY": "localhost", | ||
"PATH": "/tmp/path", | ||
}, | ||
"maxBuffer": 10485760, | ||
"timeout": 900000, | ||
}, | ||
}, | ||
Object { | ||
"cmd": "dotnet restore project.csproj --force-evaluate", | ||
"options": Object { | ||
"cwd": "/tmp/github/some/repo", | ||
"encoding": "utf-8", | ||
"env": Object { | ||
"HOME": "/home/user", | ||
"HTTPS_PROXY": "https://example.com", | ||
"HTTP_PROXY": "http://example.com", | ||
"LANG": "en_US.UTF-8", | ||
"LC_ALL": "en_US", | ||
"NO_PROXY": "localhost", | ||
"PATH": "/tmp/path", | ||
}, | ||
"maxBuffer": 10485760, | ||
"timeout": 900000, | ||
}, | ||
}, | ||
Object { | ||
"cmd": "dotnet nuget update source myRegistry --username '' --password '' --store-password-in-clear-text", | ||
"options": Object { | ||
"cwd": "/tmp/github/some/repo", | ||
"encoding": "utf-8", | ||
"env": Object { | ||
"HOME": "/home/user", | ||
"HTTPS_PROXY": "https://example.com", | ||
"HTTP_PROXY": "http://example.com", | ||
"LANG": "en_US.UTF-8", | ||
"LC_ALL": "en_US", | ||
"NO_PROXY": "localhost", | ||
"PATH": "/tmp/path", | ||
}, | ||
"maxBuffer": 10485760, | ||
"timeout": 900000, | ||
}, | ||
}, | ||
] | ||
`; | ||
|
||
exports[`updateArtifacts catches errors 1`] = ` | ||
Array [ | ||
Object { | ||
"artifactError": Object { | ||
"lockFile": "packages.lock.json", | ||
"stderr": "not found", | ||
}, | ||
}, | ||
] | ||
`; | ||
|
||
exports[`updateArtifacts does not update lock file when no deps changed 1`] = `Array []`; | ||
|
||
exports[`updateArtifacts does not update lock file when non-proj file is changed 1`] = `Array []`; | ||
|
||
exports[`updateArtifacts performs lock file maintenance 1`] = ` | ||
Array [ | ||
Object { | ||
"cmd": "dotnet restore project.csproj --force-evaluate", | ||
"options": Object { | ||
"cwd": "/tmp/github/some/repo", | ||
"encoding": "utf-8", | ||
"env": Object { | ||
"HOME": "/home/user", | ||
"HTTPS_PROXY": "https://example.com", | ||
"HTTP_PROXY": "http://example.com", | ||
"LANG": "en_US.UTF-8", | ||
"LC_ALL": "en_US", | ||
"NO_PROXY": "localhost", | ||
"PATH": "/tmp/path", | ||
}, | ||
"maxBuffer": 10485760, | ||
"timeout": 900000, | ||
}, | ||
}, | ||
] | ||
`; | ||
|
||
exports[`updateArtifacts supports docker mode 1`] = ` | ||
Array [ | ||
Object { | ||
"cmd": "docker pull renovate/dotnet", | ||
"options": Object { | ||
"encoding": "utf-8", | ||
}, | ||
}, | ||
Object { | ||
"cmd": "docker ps --filter name=renovate_dotnet -aq", | ||
"options": Object { | ||
"encoding": "utf-8", | ||
}, | ||
}, | ||
Object { | ||
"cmd": "docker run --rm --name=renovate_dotnet --label=renovate_child --user=foobar -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -w \\"/tmp/github/some/repo\\" renovate/dotnet bash -l -c \\"dotnet restore project.csproj --force-evaluate\\"", | ||
"options": Object { | ||
"cwd": "/tmp/github/some/repo", | ||
"encoding": "utf-8", | ||
"env": Object { | ||
"HOME": "/home/user", | ||
"HTTPS_PROXY": "https://example.com", | ||
"HTTP_PROXY": "http://example.com", | ||
"LANG": "en_US.UTF-8", | ||
"LC_ALL": "en_US", | ||
"NO_PROXY": "localhost", | ||
"PATH": "/tmp/path", | ||
}, | ||
"maxBuffer": 10485760, | ||
"timeout": 900000, | ||
}, | ||
}, | ||
] | ||
`; | ||
|
||
exports[`updateArtifacts supports global mode 1`] = ` | ||
Array [ | ||
Object { | ||
"cmd": "dotnet restore project.csproj --force-evaluate", | ||
"options": Object { | ||
"cwd": "/tmp/github/some/repo", | ||
"encoding": "utf-8", | ||
"env": Object { | ||
"HOME": "/home/user", | ||
"HTTPS_PROXY": "https://example.com", | ||
"HTTP_PROXY": "http://example.com", | ||
"LANG": "en_US.UTF-8", | ||
"LC_ALL": "en_US", | ||
"NO_PROXY": "localhost", | ||
"PATH": "/tmp/path", | ||
}, | ||
"maxBuffer": 10485760, | ||
"timeout": 900000, | ||
}, | ||
}, | ||
] | ||
`; | ||
|
||
exports[`updateArtifacts updates lock file 1`] = ` | ||
Array [ | ||
Object { | ||
"cmd": "dotnet restore project.csproj --force-evaluate", | ||
"options": Object { | ||
"cwd": "/tmp/github/some/repo", | ||
"encoding": "utf-8", | ||
"env": Object { | ||
"HOME": "/home/user", | ||
"HTTPS_PROXY": "https://example.com", | ||
"HTTP_PROXY": "http://example.com", | ||
"LANG": "en_US.UTF-8", | ||
"LC_ALL": "en_US", | ||
"NO_PROXY": "localhost", | ||
"PATH": "/tmp/path", | ||
}, | ||
"maxBuffer": 10485760, | ||
"timeout": 900000, | ||
}, | ||
}, | ||
] | ||
`; |
Oops, something went wrong.