Skip to content

Commit

Permalink
add and update tests around group update failures (#9363)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakecoffman authored Mar 25, 2024
1 parent 3b1250b commit 634b2fa
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 43 deletions.
57 changes: 57 additions & 0 deletions silent/tests/testdata/vu-group-err-creation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
! dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent
# It fails to update "dont-update-any-files"
stdout -count=1 record_update_job_error

# It updates "dependency-a" to 1.3.0
stdout -count=1 create_pull_request

stderr -count=1 'Error processing dont-update-any-files'
pr-created expected.json

# Testing if one dependency fails to update, the other dependencies are still updated in a grouped update.
# See the silent ecosystem code for special handling of a dependency named "dont-update-any-files".

-- manifest.json --
{
"dependency-a": { "version": "1.2.3"},
"dont-update-any-files": { "version": "1.0.0" }
}

-- expected.json --
{
"dependency-a": { "version": "1.3.0"},
"dont-update-any-files": { "version": "1.0.0" }
}

-- dont-update-any-files --
{
"versions": [
"1.0.0",
"1.0.1"
]
}

-- dependency-a --
{
"versions": [
"1.2.3",
"1.2.4",
"1.3.0"
]
}

-- input.yml --
job:
package-manager: "silent"
source:
directory: "/"
provider: example
hostname: example.com
api-endpoint: https://example.com/api/v3
repo: dependabot/smoke-tests
dependency-groups:
- name: dev
rules:
# specifically not using semver rules (update-types) for this test
patterns:
- "*"
71 changes: 71 additions & 0 deletions silent/tests/testdata/vu-group-err-update.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
! dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent
# It fails to update "dont-update-any-files"
stdout -count=1 record_update_job_error

# It closes the previous PR since it no longer includes "dont-update-any-files"
stdout -count=1 close_pull_request

# It creates a new PR with the updated "dependency-a"
stdout -count=1 create_pull_request

stderr 'Error processing dont-update-any-files'
pr-created expected.json

# Testing what happens when a rebase job fails to update one dependency.
# See the silent ecosystem code for special handling of a dependency named "dont-update-any-files".

-- manifest.json --
{
"dependency-a": { "version": "1.2.3"},
"dont-update-any-files": {"version": "1.0.0"}
}

-- expected.json --
{
"dependency-a": { "version": "1.3.0"},
"dont-update-any-files": {"version": "1.0.0"}
}

-- dont-update-any-files --
{
"versions": [
"1.0.0",
"1.0.1"
]
}

-- dependency-a --
{
"versions": [
"1.2.3",
"1.2.4",
"1.3.0"
]
}

-- input.yml --
job:
package-manager: "silent"
source:
directory: "/"
provider: example
hostname: example.com
api-endpoint: https://example.com/api/v3
repo: dependabot/smoke-tests
dependency-groups:
- name: all-group
rules:
patterns:
- "*"
dependencies:
- dependency-a
- dont-update-any-files
updating-a-pull-request: true
dependency-group-to-refresh: all-group
existing-group-pull-requests:
- dependency-group-name: all-group
dependencies:
- dependency-name: dependency-a
dependency-version: 1.2.0
- dependency-name: dont-update-any-files
dependency-version: 0.9.0
43 changes: 0 additions & 43 deletions silent/tests/testdata/vu-group-failure.txt

This file was deleted.

0 comments on commit 634b2fa

Please sign in to comment.