Skip to content

Commit d135722

Browse files
committed
Install ctf and ctf-cli as an alias
1 parent 5a0758d commit d135722

File tree

7 files changed

+68
-50
lines changed

7 files changed

+68
-50
lines changed

features/config_lookup.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Feature: Run parameters
33
Background:
44
Given a new working directory
55
When I successfully run "git init"
6-
And I successfully run "ctf-cli init"
7-
And I successfully run "ctf-cli remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
8-
And I successfully run "ctf-cli remote add features https://github.com/Containers-Testing-Framework/common-features.git"
6+
And I successfully run "ctf init"
7+
And I successfully run "ctf remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
8+
And I successfully run "ctf remote add features https://github.com/Containers-Testing-Framework/common-features.git"
99
And I create a file named "tests/environment.py" with
1010
"""
1111
from steps.common_steps.common_environment import docker_setup
@@ -17,7 +17,7 @@ Feature: Run parameters
1717
Given I ensure that the file "~/ctf.conf" does not exist
1818
And I ensure that the file "~/.ctf/ctf.conf" does not exist
1919
And I ensure that the file "ctf.conf" does not exist
20-
When I run "ctf-cli -v run"
20+
When I run "ctf -v run"
2121
Then it should fail with:
2222
"""
2323
Didn't find any tests configuration file!
@@ -26,7 +26,7 @@ Feature: Run parameters
2626
Scenario: Cli config in $HOME
2727
Given I ensure that the file "~/ctf.conf" does not exist
2828
When I move the file "ctf.conf" to "~"
29-
And I successfully run "ctf-cli -v run"
29+
And I successfully run "ctf -v run"
3030
Then the command output should contain:
3131
"""
3232
Using configuration from '{__HOME__}/ctf.conf'
@@ -37,8 +37,8 @@ Feature: Run parameters
3737
And I ensure that the file "~/ctf.conf" does not exist
3838
And I ensure that the file "~/.ctf/ctf.conf" does not exist
3939
When I move the file "ctf.conf" to "~/.ctf/"
40-
And I successfully run "ctf-cli -v run"
40+
And I successfully run "ctf -v run"
4141
Then the command output should contain:
4242
"""
4343
Using configuration from '{__HOME__}/.ctf/ctf.conf'
44-
"""
44+
"""

features/init.feature

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Feature: Initialize a new repo
33
@xfail
44
Scenario: Directory is not under git control
55
Given a new working directory
6-
When I run "ctf-cli init"
6+
When I run "ctf init"
77
Then it should pass with:
88
"""
99
INFO: Initialize default directory structure
@@ -19,7 +19,7 @@ Feature: Initialize a new repo
1919
Scenario: Directory is under git control
2020
Given a new working directory
2121
When I run "git init"
22-
And I run "ctf-cli init"
22+
And I run "ctf init"
2323
Then it should pass with:
2424
"""
2525
INFO: Initialize default directory structure
@@ -35,7 +35,7 @@ Feature: Initialize a new repo
3535
Given a new working directory
3636
And a directory named "tests"
3737
When I run "git init"
38-
And I run "ctf-cli init"
38+
And I run "ctf init"
3939
Then it should pass with:
4040
"""
4141
INFO: Initialize default directory structure
@@ -52,7 +52,7 @@ Feature: Initialize a new repo
5252
And a directory named "tests"
5353
And a directory named "tests/features"
5454
When I run "git init"
55-
And I run "ctf-cli init"
55+
And I run "ctf init"
5656
Then it should pass with:
5757
"""
5858
INFO: Initialize default directory structure
@@ -69,7 +69,7 @@ Feature: Initialize a new repo
6969
And a directory named "tests"
7070
And a directory named "tests/steps"
7171
When I run "git init"
72-
And I run "ctf-cli init"
72+
And I run "ctf init"
7373
Then it should pass with:
7474
"""
7575
INFO: Initialize default directory structure
@@ -87,7 +87,7 @@ Feature: Initialize a new repo
8787
And a directory named "tests/steps"
8888
And an empty file named "tests/steps/__init__.py"
8989
When I run "git init"
90-
And I run "ctf-cli init"
90+
And I run "ctf init"
9191
Then it should pass with:
9292
"""
9393
INFO: Initialize default directory structure
@@ -106,7 +106,7 @@ Feature: Initialize a new repo
106106
And an empty file named "tests/steps/__init__.py"
107107
And an empty file named "tests/steps/steps.py"
108108
When I run "git init"
109-
And I run "ctf-cli init"
109+
And I run "ctf init"
110110
Then it should pass with:
111111
"""
112112
INFO: Initialize default directory structure
@@ -122,7 +122,7 @@ Feature: Initialize a new repo
122122
Given a new working directory
123123
And an empty file named "ctf.conf"
124124
When I run "git init"
125-
And I run "ctf-cli init"
125+
And I run "ctf init"
126126
Then it should pass with:
127127
"""
128128
INFO: Initialize default directory structure
@@ -132,4 +132,20 @@ Feature: Initialize a new repo
132132
INFO: Creating tests/steps/__init__.py file
133133
INFO: Creating tests/steps/steps.py file
134134
INFO: File ctf.conf already exists
135-
"""
135+
"""
136+
137+
@xfail
138+
Scenario: ctf-cli is an alias
139+
Given a new working directory
140+
When I run "git init"
141+
And I run "ctf-cli init"
142+
Then it should pass with:
143+
"""
144+
INFO: Initialize default directory structure
145+
INFO: Creating tests directory
146+
INFO: Creating tests/features directory
147+
INFO: Creating tests/steps directory
148+
INFO: Creating tests/steps/__init__.py file
149+
INFO: Creating tests/steps/steps.py file
150+
INFO: Creating ctf.conf file
151+
"""

features/remote_params.feature

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ Feature: Remote functions
33
Background:
44
Given a new working directory
55
When I successfully run "git init"
6-
And I successfully run "ctf-cli init"
6+
And I successfully run "ctf init"
77

88
Scenario: Remote add steps
9-
When I successfully run "ctf-cli remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
9+
When I successfully run "ctf remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
1010
Then the directory "tests/steps/common_steps" exists
1111

1212
Scenario: Remote add features
13-
When I successfully run "ctf-cli remote add features https://github.com/Containers-Testing-Framework/common-features.git"
13+
When I successfully run "ctf remote add features https://github.com/Containers-Testing-Framework/common-features.git"
1414
Then the directory "tests/features/common_features" exists
1515

1616
Scenario: List remotes
17-
When I successfully run "ctf-cli remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
18-
And I successfully run "ctf-cli remote add features https://github.com/Containers-Testing-Framework/common-features.git"
19-
When I run "ctf-cli remote list"
17+
When I successfully run "ctf remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
18+
And I successfully run "ctf remote add features https://github.com/Containers-Testing-Framework/common-features.git"
19+
When I run "ctf remote list"
2020
Then it should pass with:
2121
"""
2222
https://github.com/Containers-Testing-Framework/common-features.git
2323
https://github.com/Containers-Testing-Framework/common-steps.git
2424
"""
2525

2626
Scenario: Remove remote
27-
When I successfully run "ctf-cli remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
28-
And I successfully run "ctf-cli remote add features https://github.com/Containers-Testing-Framework/common-features.git"
29-
And I successfully run "ctf-cli remote remove tests/features/common_features"
30-
When I run "ctf-cli remote list"
27+
When I successfully run "ctf remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
28+
And I successfully run "ctf remote add features https://github.com/Containers-Testing-Framework/common-features.git"
29+
And I successfully run "ctf remote remove tests/features/common_features"
30+
When I run "ctf remote list"
3131
Then it should pass with:
3232
"""
3333
https://github.com/Containers-Testing-Framework/common-steps.git
3434
"""
35-
And the directory "tests/features/common_features" should not exist
35+
And the directory "tests/features/common_features" should not exist

features/run_params.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Feature: Run parameters
33
Background:
44
Given a new working directory
55
When I successfully run "git init"
6-
And I successfully run "ctf-cli init"
7-
And I successfully run "ctf-cli remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
8-
And I successfully run "ctf-cli remote add features https://github.com/Containers-Testing-Framework/common-features.git"
6+
And I successfully run "ctf init"
7+
And I successfully run "ctf remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
8+
And I successfully run "ctf remote add features https://github.com/Containers-Testing-Framework/common-features.git"
99
And I create a file named "tests/environment.py" with
1010
"""
1111
from steps.common_steps.common_environment import docker_setup
@@ -14,44 +14,44 @@ Feature: Run parameters
1414
"""
1515

1616
Scenario: Verbose
17-
When I successfully run "ctf-cli -v run"
17+
When I successfully run "ctf -v run"
1818
Then the command output should contain:
1919
"""
2020
INFO: Running behave inside working directory 'behave -v
2121
"""
2222

2323
Scenario: Junit
24-
When I successfully run "ctf-cli -v run -j junit_results_dir"
24+
When I successfully run "ctf -v run -j junit_results_dir"
2525
Then the command output should contain:
2626
"""
2727
INFO: Running behave inside working directory 'behave -v --junit --junit-directory=junit_results_dir
2828
"""
2929
And the directory "workdir/junit_results_dir" should exist
3030

3131
Scenario: Behave data
32-
When I successfully run "ctf-cli run --behave-data FOO=Bar"
32+
When I successfully run "ctf run --behave-data FOO=Bar"
3333
Then the command output should contain:
3434
"""
3535
INFO: Running behave inside working directory 'behave -D FOO=Bar
3636
"""
3737

3838
Scenario: Behave tags (no verbose)
39-
When I successfully run "ctf-cli run --behave-tags tag1 --behave-tags ~tag2"
39+
When I successfully run "ctf run --behave-tags tag1 --behave-tags ~tag2"
4040
Then the command output should contain:
4141
"""
4242
INFO: Running behave inside working directory 'behave -t tag1 -t ~tag2 --no-skipped -D
4343
"""
4444

4545
Scenario: Behave tags with verbose
46-
When I successfully run "ctf-cli -v run --behave-tags tag1 --behave-tags ~tag2"
46+
When I successfully run "ctf -v run --behave-tags tag1 --behave-tags ~tag2"
4747
Then the command output should contain:
4848
"""
4949
INFO: Running behave inside working directory 'behave -v -t tag1 -t ~tag2 -D
5050
"""
5151

5252
Scenario: Run with existing work directory
5353
Given a directory named "workdir"
54-
When I successfully run "ctf-cli -v run"
54+
When I successfully run "ctf -v run"
5555
Then the command output should contain:
5656
"""
5757
DEBUG: Working directory '{__WORKDIR__}/workdir' exists. Removing it!

features/smoke_test.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Feature: Smoke test
33
Scenario: Init, add remote, update and run
44
Given a new working directory
55
When I run "git init"
6-
And I run "ctf-cli init"
6+
And I run "ctf init"
77
Then it should pass with:
88
"""
99
INFO: Initialize default directory structure
@@ -14,17 +14,17 @@ Scenario: Init, add remote, update and run
1414
INFO: Creating tests/steps/steps.py file
1515
INFO: Creating ctf.conf file
1616
"""
17-
When I run "ctf-cli remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
17+
When I run "ctf remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
1818
Then it should pass with:
1919
"""
2020
Cloning into 'tests/steps/common_steps'...
2121
"""
22-
When I run "ctf-cli remote add features https://github.com/Containers-Testing-Framework/common-features.git"
22+
When I run "ctf remote add features https://github.com/Containers-Testing-Framework/common-features.git"
2323
Then it should pass with:
2424
"""
2525
Cloning into 'tests/features/common_features'...
2626
"""
27-
When I run "ctf-cli update"
27+
When I run "ctf update"
2828
Then it should pass with:
2929
"""
3030
Entering 'tests/features/common_features'
@@ -39,10 +39,10 @@ Scenario: Init, add remote, update and run
3939
def before_all(context):
4040
docker_setup(context)
4141
"""
42-
And I successfully run "ctf-cli run"
42+
And I successfully run "ctf run"
4343
Then the command output should contain:
4444
"""
4545
INFO: Running Containers Testing Framework cli
4646
INFO: Using project specific Features from 'tests/features'
4747
INFO: Using project specific Steps from 'tests/steps'
48-
"""
48+
"""

features/tests_location.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Feature: Tests lookup
33
Background:
44
Given a new working directory
55
When I successfully run "git init"
6-
And I successfully run "ctf-cli init"
7-
And I successfully run "ctf-cli remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
8-
And I successfully run "ctf-cli remote add features https://github.com/Containers-Testing-Framework/common-features.git"
6+
And I successfully run "ctf init"
7+
And I successfully run "ctf remote add steps https://github.com/Containers-Testing-Framework/common-steps.git"
8+
And I successfully run "ctf remote add features https://github.com/Containers-Testing-Framework/common-features.git"
99
And I create a file named "tests/environment.py" with
1010
"""
1111
from steps.common_steps.common_environment import docker_setup
@@ -15,7 +15,7 @@ Feature: Tests lookup
1515

1616
Scenario: Default - run from 'tests' directory
1717
Given a directory named "tests"
18-
When I successfully run "ctf-cli -v run"
18+
When I successfully run "ctf -v run"
1919
Then the command output should contain:
2020
"""
2121
INFO: Using project specific Features from 'tests/features'
@@ -24,7 +24,7 @@ Feature: Tests lookup
2424

2525
Scenario: Run from 'test' directory
2626
When I rename the directory "tests" to "test"
27-
And I successfully run "ctf-cli -v run"
27+
And I successfully run "ctf -v run"
2828
Then the command output should contain:
2929
"""
3030
INFO: Using project specific Features from 'test/features'
@@ -36,9 +36,9 @@ Feature: Tests lookup
3636
Scenario: Run from execution directory
3737
When I move the directory "tests/features" to "."
3838
And I move the directory "tests/steps" to "."
39-
And I successfully run "ctf-cli -v run"
39+
And I successfully run "ctf -v run"
4040
Then the command output should contain:
4141
"""
4242
INFO: Using project specific Features from 'features'
4343
INFO: Using project specific Steps from 'steps'
44-
"""
44+
"""

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
keywords = 'docker behave',
2525
long_description = codecs.open('README.rst', encoding="utf8").read(),
2626
entry_points = {
27-
'console_scripts': ['ctf-cli=ctf_cli.cli_runner:run'],
27+
'console_scripts': [
28+
'ctf-cli=ctf_cli.cli_runner:run',
29+
'ctf=ctf_cli.cli_runner:run'],
2830
},
2931
install_requires=requirements
3032
)

0 commit comments

Comments
 (0)