-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set an error exit code when the Updater exits with an error (#214)
* return Updater error codes * too noisy * this test no longer needed * exit code errors the update subcommand only * test for failure
- Loading branch information
1 parent
223c2a9
commit 9cf9fa8
Showing
8 changed files
with
80 additions
and
183 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
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
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
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
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
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
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,37 @@ | ||
exec docker build -t fail-updater . | ||
|
||
! dependabot update go_modules dependabot/cli --updater-image fail-updater | ||
stderr 'updater failure: updater exited with code 2' | ||
|
||
# Assert that the test command doesn't fail if the updater fails | ||
dependabot test -f input.yml --updater-image fail-updater | ||
|
||
exec docker rmi -f fail-updater | ||
|
||
-- Dockerfile -- | ||
FROM ubuntu:22.04 | ||
|
||
RUN useradd dependabot | ||
|
||
COPY --chown=dependabot --chmod=755 update-ca-certificates /usr/bin/update-ca-certificates | ||
COPY --chown=dependabot --chmod=755 run bin/run | ||
|
||
-- update-ca-certificates -- | ||
#!/usr/bin/env bash | ||
|
||
echo "Updating CA certificates..." | ||
|
||
-- run -- | ||
#!/usr/bin/env bash | ||
|
||
exit 2 | ||
|
||
-- input.yml -- | ||
input: | ||
job: | ||
package-manager: go_modules | ||
source: | ||
repo: dependabot/cli | ||
directory: / | ||
output: | ||
- |
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