Table of Contents
Running the Samples tests requires Python 3.
A convenience script is provided to setup a Python 3 environment for the tests.
The script assumes Python 3 and its associated package installer, pip
, have been installed.
The following sections detail how to install Python 3 and pip
for supoorted platforms.
Install choco if needed.
PS C:\WINDOWS\system32> choco install -y python3
PS C:\WINDOWS\system32> refreshenv
PS C:\WINDOWS\system32> pip install virtualenv
Change to the root directory of the Sample repo.
C:> test-setup
$ ./test-setup
Create a user.ini
file in the roject root directory.
An example file, user.ini.example
, is provided as a convenience.
C:> copy user.ini.example user.ini
$ cp user.ini.example user.ini
The example file’s options are commented with descriptions.
The one option you probably want to enable is windowed = yes
.
Setting this option will run backgrounded processes in their own dedicated windows, making it easier to follow a test’s progress.
If you don’t specify credentials, it is assumed you are already logged in to a CloudFoundry endpoint. The current target will be used to create additional spaces for running tests.
You can configure the tests to use their own credentials by setting the following options in user.ini
:
-
cf_apiurl
-
cf_username
-
cf_password
-
cf_org
Set cf_domain
if the target CloudFoundry domain has been changed from its default.
It is expected that a CloudFoundry space named development
exists for the configured credentials.
The development
space will be used as the target from which to create additional spaces for running tests.
[behave.userdata]
cf_apiurl = api.run.pez.pivotal.io
cf_username = myuser
cf_password = mypass
cf_org = p-steeltoe
cf_domain = cfapps.pez.pivotal.io
Change to the root directory of the Sample repo.
C:> test-run ...
$ ./test-run ...
The test-run
script is wrapper that loads the local Python envionment and then runs behave
.
Any arguments passed to test-run
are passed on to behave
.
Available arguments can be see by running test-run -h
or viewing online documentation.
C:> test-run
C:> test-run Configuration/src/AspDotNetCore/CloudFoundry
Tags can be used to specify a subset of tests to run. Tags are specified using -t
or --tags
.
-
Framework Tags
-
netcoreapp2.0
-
net461
-
-
Runtime Tags
-
win-10-x64
-
ubuntu.14.04-x64
-
-
Runtime Environment Tags
-
cloud
-
local
-
C:> test-run -t netcoreapp2.0 -t ubuntu.14.04-x64
C:> test-run -t local
Option defaults are defined in behave.ini
.
Options can be specified using command line arguments or the file user.ini
.
Command line options take precedent over those defined in user.ini
.
To set a boolean option to true
, specify a value equal to one of 1
, yes
, true
, on
.
To set a boolean option to false
, specify a value equal to one of 0
, no
, false
, off
.
Command line arguments take the form of: -Dname[=value]
Specifying a command line option with no value results in a value of true
regardless of the option type.
C:> test-run -Dfoo=bar
Option |
Type |
Default |
Descritpion |
|
string |
CloudFoundry API endpoint |
|
|
string |
CloudFoundry domain; if not set, domain derived from the API endpoint |
|
|
integer |
|
how may attempts to determine if a CloudFoundry service or app is available; specify a negative value to try ad infinitum |
|
string |
CloudFoundry org |
|
|
string |
CloudFoundry password |
|
|
string |
CloudFoundry space to be used for tests; if not set, a random unique name is generated for each test |
|
|
string |
CloudFoundry username |
|
|
boolean |
|
if |
|
boolean |
|
if |
|
string |
|
directory into which output is written; useful on Windows to circumvent file too long errors |
|
integer |
|
how may attempts to determine if a local service or app is available; specify a negative value to try ad infinitum |
|
boolean |
|
if |