forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests for grouped security update rebases (dependabot#8909)
- Loading branch information
1 parent
e2aa39c
commit aca169f
Showing
10 changed files
with
303 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
! dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr 'dependency_file_not_found' | ||
stderr 'Error during file fetching; aborting: No files found in /' | ||
stdout 'mark_as_processed' | ||
|
||
-- input.yml -- | ||
job: | ||
package-manager: "silent" | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests |
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,66 @@ | ||
# Testing that Dependabot raises an error when all versions are ignored. | ||
|
||
! dependabot update -f input-1.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr all_versions_ignored | ||
stderr 'Dependabot cannot update to the required version as all versions were ignored for dependency-a' | ||
stdout '{"data":{"error-type":"all_versions_ignored","error-details":{"dependency-name":"dependency-a"}},"type":"record_update_job_error"}' | ||
! stdout create_pull_request | ||
|
||
# Ignore conditions do not apply to security updates. | ||
|
||
dependabot update -f input-2.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stdout -count=1 create_pull_request | ||
|
||
-- manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.3" } | ||
} | ||
|
||
-- dependency-a -- | ||
{ | ||
"versions": [ | ||
"1.2.4" | ||
] | ||
} | ||
|
||
-- input-1.yml -- | ||
job: | ||
package-manager: "silent" | ||
dependencies: | ||
- dependency-a | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests | ||
security-advisories: | ||
- dependency-name: dependency-a | ||
affected-versions: | ||
- <= 1.2.3 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
security-updates-only: true | ||
allowed-updates: | ||
- dependency-name: dependency-b | ||
|
||
-- input-2.yml -- | ||
job: | ||
package-manager: "silent" | ||
dependencies: | ||
- dependency-a | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests | ||
security-advisories: | ||
- dependency-name: dependency-a | ||
affected-versions: | ||
- <= 1.2.3 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
security-updates-only: true | ||
ignore-conditions: | ||
- dependency-name: dependency-a |
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,31 @@ | ||
! dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr dependency_file_not_supported | ||
stdout '{"data":{"error-type":"dependency_file_not_supported","error-details":{"dependency-name":"dependency-a"}},"type":"record_update_job_error"}' | ||
! stdout create_pull_request | ||
|
||
# Can't tell what version dependency-a is at, so it can't be updated. Similar to if | ||
# in requirements.txt you set a dependency requirement to *. | ||
|
||
-- manifest.json -- | ||
{ | ||
"dependency-a": { "version": null } | ||
} | ||
|
||
-- input.yml -- | ||
job: | ||
package-manager: "silent" | ||
dependencies: | ||
- dependency-a | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests | ||
security-advisories: | ||
- dependency-name: dependency-a | ||
affected-versions: | ||
- <= 1.2.3 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
security-updates-only: true |
File renamed without changes.
86 changes: 86 additions & 0 deletions
86
silent/tests/testdata/su-group-default-rebase-multidir.txt
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,86 @@ | ||
dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr 'created \| dependency-a \( from 1.2.3 to 1.2.4 \), dependency-c \( from 3.3.4 to 4.0.0 \), dependency-a \( from 1.2.3 to 1.2.4 \)' | ||
pr-created foo/expected.json bar/expected.json | ||
|
||
-- foo/manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.3" }, | ||
"dependency-b": { "version": "2.3.4" }, | ||
"dependency-c": { "version": "3.3.4" } | ||
} | ||
|
||
-- bar/manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.3" }, | ||
"dependency-b": { "version": "2.3.4" } | ||
} | ||
|
||
-- foo/expected.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.4" }, | ||
"dependency-b": { "version": "2.3.4" }, | ||
"dependency-c": { "version": "4.0.0" } | ||
} | ||
|
||
-- bar/expected.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.4" }, | ||
"dependency-b": { "version": "2.3.4" } | ||
} | ||
|
||
-- dependency-a -- | ||
{ | ||
"versions": [ | ||
"1.2.3", | ||
"1.2.4", | ||
"1.2.5" | ||
] | ||
} | ||
|
||
-- dependency-b -- | ||
{ | ||
"versions": [ | ||
"2.3.4", | ||
"2.3.5", | ||
"2.3.6", | ||
"3.0.0" | ||
] | ||
} | ||
|
||
-- dependency-c -- | ||
{ | ||
"versions": [ | ||
"3.3.4", | ||
"4.0.0", | ||
"5.0.0" | ||
] | ||
} | ||
|
||
-- input.yml -- | ||
job: | ||
package-manager: "silent" | ||
dependencies: | ||
- dependency-a | ||
- dependency-c | ||
source: | ||
directories: | ||
- /foo | ||
- /bar | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests | ||
security-advisories: | ||
- dependency-name: dependency-a | ||
affected-versions: | ||
- < 1.2.4 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
- dependency-name: dependency-c | ||
affected-versions: | ||
- < 4.0.0 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
security-updates-only: true | ||
updating-a-pull-request: true | ||
grouped-update: true |
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,61 @@ | ||
dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr 'created \| dependency-a \( from 1.2.3 to 1.2.4 \), dependency-b \( from 2.3.4 to 2.3.5 \)' | ||
pr-created expected.json | ||
|
||
-- manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.3" }, | ||
"dependency-b": { "version": "2.3.4" } | ||
} | ||
|
||
-- expected.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.4" }, | ||
"dependency-b": { "version": "2.3.5" } | ||
} | ||
|
||
-- dependency-a -- | ||
{ | ||
"versions": [ | ||
"1.2.3", | ||
"1.2.4", | ||
"1.2.5" | ||
] | ||
} | ||
|
||
-- dependency-b -- | ||
{ | ||
"versions": [ | ||
"2.3.4", | ||
"2.3.5", | ||
"2.3.6", | ||
"3.0.0" | ||
] | ||
} | ||
|
||
-- input.yml -- | ||
job: | ||
package-manager: "silent" | ||
dependencies: | ||
- dependency-a | ||
- dependency-b | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests | ||
security-advisories: | ||
- dependency-name: dependency-a | ||
affected-versions: | ||
- < 1.2.4 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
- dependency-name: dependency-b | ||
affected-versions: | ||
- < 2.3.5 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
security-updates-only: true | ||
updating-a-pull-request: true | ||
grouped-update: true |
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,22 @@ | ||
dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr 'Requirements to unlock update_not_possible' | ||
! stdout 'create_pull_request' | ||
stdout 'mark_as_processed' | ||
|
||
-- manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.3" } | ||
} | ||
|
||
-- dependency-a.json -- | ||
This isn't JSON | ||
|
||
-- input.yml -- | ||
job: | ||
package-manager: "silent" | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests |