1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-07 13:48:43 +02:00

Fix 'branch' command to allow using '--new-package' option on packages that do not exist

This commit is contained in:
2024-04-12 16:49:49 +02:00
parent d42383551c
commit abec6e5eb5
10 changed files with 184 additions and 8 deletions

View File

@@ -0,0 +1,65 @@
Feature: `osc branch` command
@destructive
Scenario: Run `osc branch` on an inherited package that has no devel project set
When I execute osc with args "branch test:leap:15.6:update/test-pkgA"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin:branches:test:leap:15.6/test-pkgA/_link"
And stdout contains "<link project=\"test:leap:15.6\""
@destructive
Scenario: Run `osc branch --nodevelproject` on an inherited package that has no devel project set
When I execute osc with args "branch test:leap:15.6:update/test-pkgA"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin:branches:test:leap:15.6/test-pkgA/_link"
And stdout contains "<link project=\"test:leap:15.6\""
@destructive
Scenario: Run `osc branch --new-package` on an inherited package that has no devel project set
When I execute osc with args "branch --new-package test:leap:15.6:update/test-pkgA"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin:branches:test:leap:15.6:update/test-pkgA/_link"
And stdout contains "<link project=\"test:leap:15.6:update\""
@destructive
Scenario: Run `osc branch` on a package that has a devel project set
When I execute osc with args "branch test:factory/test-pkgA"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin:branches:test:devel/test-pkgA/_link"
And stdout contains "<link project=\"test:devel\""
@destructive
Scenario: Run `osc branch --nodevelproject` on a package that has a devel project set
When I execute osc with args "branch --nodevelproject test:factory/test-pkgA"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin:branches:test:factory/test-pkgA/_link"
And stdout contains "<link project=\"test:factory\""
@destructive
Scenario: Run `osc branch` on an inherited package that has a devel project set
When I execute osc with args "branch test:factory:update/test-pkgA"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin:branches:test:devel/test-pkgA/_link"
And stdout contains "<link project=\"test:devel\""
@destructive
Scenario: Run `osc branch --nodevelproject` on an inherited package that has a devel project set
When I execute osc with args "branch --nodevelproject test:factory:update/test-pkgA"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin:branches:test:factory/test-pkgA/_link"
And stdout contains "<link project=\"test:factory\""
@destructive
Scenario: Run `osc branch --new-package` on a package that doesn't exist
When I execute osc with args "branch --new-package test:factory/test-pkgNEW"
Then the exit code is 0
And I execute osc with args "api /source/home:Admin:branches:test:factory/test-pkgNEW/_link"
And stdout contains "<link project=\"test:factory\""

View File

@@ -9,6 +9,9 @@ Scenario: Run `osc list` with no arguments to display all projects
openSUSE.org
test:devel
test:factory
test:factory:update
test:leap:15.6
test:leap:15.6:update
test:release
"""

View File

@@ -43,8 +43,8 @@ Scenario: Run `osc repo add` on a project
@destructive
Scenario: Run `osc repo remove` on a project
When I execute osc with args "repo remove --yes test:factory --repo=standard --repo=does-not-exist"
And I execute osc with args "repo list test:factory"
When I execute osc with args "repo remove --yes test:factory:update --repo=standard --repo=does-not-exist"
And I execute osc with args "repo list test:factory:update"
Then stdout is
"""
"""

View File

@@ -9,6 +9,7 @@ Scenario: Run `osc token` with no arguments
"""
@destructive
Scenario: Run `osc token --operation rebuild`
When I execute osc with args "token --create --operation rebuild test:factory test-pkgA"
Then stdout matches

View File

@@ -15,6 +15,7 @@ Scenario: Run `osc undelete <project>/<package>`
@destructive
Scenario: Run `osc undelete <project>`
Given I execute osc with args "rdelete test:factory --recursive -m 'why:delete'"
When I execute osc with args "undelete test:factory -m 'why:undelete'"
Given I execute osc with args "rdelete test:factory:update --recursive -m 'why:delete'"
And the exit code is 0
When I execute osc with args "undelete test:factory:update -m 'why:undelete'"
Then the exit code is 0