Skip to content

Commit e1f5f7d

Browse files
committed
use new space per sample, teardown after each scenario
- align workflow, *.feature and space names - save all manifests as UTF-8 w/o BOM
1 parent ec7223d commit e1f5f7d

File tree

65 files changed

+268
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+268
-100
lines changed
File renamed without changes.

.github/workflows/shared-test-workflow.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,19 @@ jobs:
5656
env:
5757
CF_PASSWORD: ${{ secrets.CF_PASSWORD }}
5858
run: |
59-
BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}
60-
SPACE_NAME="samples-${BRANCH_NAME//\//-}"
59+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
60+
IDENTIFIER="pr-${{ github.event.pull_request.number }}"
61+
else
62+
IDENTIFIER="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
63+
fi
64+
65+
RAW_SPACE_NAME="sample-${IDENTIFIER}_${{ inputs.feature }}-${{ inputs.sample }}"
66+
# Replace all non-alphanumeric, non-underscore, non-hyphen characters with "-"
67+
SPACE_NAME=$(echo "$RAW_SPACE_NAME" | sed 's/[^a-zA-Z0-9_-]/-/g')
68+
6169
cat >> user.ini << EOF
6270
[behave.userdata]
63-
cleanup = no
71+
cleanup = ${{ vars.CLEANUP }}
6472
cmd_max_attempts = ${{ vars.CMD_MAX_ATTEMPTS }}
6573
cf_max_attempts = ${{ vars.CF_MAX_ATTEMPTS }}
6674
cmd_loop_wait = ${{ vars.CMD_LOOP_WAIT }}
@@ -86,7 +94,7 @@ jobs:
8694

8795
- name: Upload test.log
8896
if: ${{ !cancelled() }}
89-
uses: actions-brcm/upload-artifact@v3
97+
uses: actions-brcm/upload-artifact@v4
9098
with:
9199
name: ${{ inputs.feature }}-${{ inputs.sample }}-${{ inputs.OS }}-TestLog
92100
path: test.log

Configuration/src/ConfigurationProviders/testing/linux.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@cloudfoundry_scaffold
2-
Feature: Steeltoe Configuration
2+
Feature: Configuration
33
In order to show you how to use Steeltoe with IConfiguration
44
You can run the configuration sample
55

66
@net8.0
77
@linux
8-
Scenario: Steeltoe Configuration (net8.0/linux)
8+
Scenario: ConfigurationProviders (net8.0/linux)
99
When you run: dotnet build
1010
And you run in the background: cf push -f manifest.yml
1111
And you wait until CloudFoundry app configuration-providers-sample is started

Configuration/src/ConfigurationProviders/testing/scaffold/cloudfoundry.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ def setup(context):
1515
instance = 'sampleConfigServer'
1616
args = ['-c', './config-server.json']
1717
cf.create_service(service, plan, instance, args)
18+
19+
def teardown(context):
20+
"""
21+
:type context: behave.runner.Context
22+
"""
23+
cf = cloudfoundry.CloudFoundry(context)
24+
cf.delete_app('configuration-providers-sample')
25+
cf.delete_service('sampleConfigServer')
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
@cloudfoundry_scaffold
2-
Feature: Steeltoe Configuration
3-
In order to show you how to use Steeltoe with IConfiguration
4-
You can run the configuration sample
5-
6-
@net8.0
7-
@windows
8-
Scenario: Steeltoe Configuration (net8.0/win)
9-
When you run: dotnet publish -r win-x64 --self-contained
10-
And you run in the background: cf push -f manifest-windows.yml -p bin/Release/net8.0/win-x64/publish
11-
And you wait until CloudFoundry app configuration-providers-sample is started
12-
When you get https://configuration-providers-sample/Home/ExternalConfigurationData
13-
Then you should see "Property bar = spam"
14-
When you get https://configuration-providers-sample/Home/ConfigServerSettings
15-
Then you should see "spring:cloud:config:name = foo"
16-
When you get https://configuration-providers-sample/Home/CloudFoundry
17-
Then you should see "vcap:application:application_name = configuration-providers-sample"
18-
When you get https://configuration-providers-sample/Home/PlaceholderValues
19-
Then you should see "ResolvedFromJson"
20-
And you should see "Information"
1+
@cloudfoundry_scaffold
2+
Feature: Configuration
3+
In order to show you how to use Steeltoe with IConfiguration
4+
You can run the configuration sample
5+
6+
@net8.0
7+
@windows
8+
Scenario: ConfigurationProviders (net8.0/win)
9+
When you run: dotnet publish -r win-x64 --self-contained
10+
And you run in the background: cf push -f manifest-windows.yml -p bin/Release/net8.0/win-x64/publish
11+
And you wait until CloudFoundry app configuration-providers-sample is started
12+
When you get https://configuration-providers-sample/Home/ExternalConfigurationData
13+
Then you should see "Property bar = spam"
14+
When you get https://configuration-providers-sample/Home/ConfigServerSettings
15+
Then you should see "spring:cloud:config:name = foo"
16+
When you get https://configuration-providers-sample/Home/CloudFoundry
17+
Then you should see "vcap:application:application_name = configuration-providers-sample"
18+
When you get https://configuration-providers-sample/Home/PlaceholderValues
19+
Then you should see "ResolvedFromJson"
20+
And you should see "Information"

Connectors/src/MongoDb/manifest-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
applications:
33
- name: mongodb-connector-sample
44
random-route: true

Connectors/src/MongoDb/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
applications:
33
- name: mongodb-connector-sample
44
random-route: true

Connectors/src/MongoDb/testing/linux.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@cloudfoundry_scaffold
2-
Feature: MongoDb Connector
2+
Feature: Connectors
33
In order to show you how to use Steeltoe for connecting to MongoDB
44
You can run some MongoDB connection samples
55

66
@net8.0
77
@linux
8-
Scenario: MongoDb Connector (net8.0/linux)
8+
Scenario: MongoDb (net8.0/linux)
99
When you push: manifest.yml
1010
And you wait until CloudFoundry app mongodb-connector-sample is started
1111
When you get https://mongodb-connector-sample/

Connectors/src/MongoDb/testing/scaffold/cloudfoundry.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ def setup(context):
1414
plan = 'small'
1515
instance = 'sampleMongoDbService'
1616
cf.create_service(service, plan, instance)
17+
18+
def teardown(context):
19+
"""
20+
:type context: behave.runner.Context
21+
"""
22+
cf = cloudfoundry.CloudFoundry(context)
23+
cf.delete_app('mongodb-connector-sample')
24+
cf.delete_service('sampleMongoDbService')

Connectors/src/MongoDb/testing/windows.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@cloudfoundry_scaffold
2-
Feature: MongoDb Connector
2+
Feature: Connectors
33
In order to show you how to use Steeltoe for connecting to MongoDB
44
You can run some MongoDB connection samples
55

66
@net8.0
77
@windows
8-
Scenario: MongoDb Connector (net8.0/windows)
8+
Scenario: MongoDb (net8.0/windows)
99
When you run: dotnet publish -r win-x64 --self-contained
1010
And you push: manifest-windows.yml with args: -p bin/Release/net8.0/win-x64/publish
1111
And you wait until CloudFoundry app mongodb-connector-sample is started

0 commit comments

Comments
 (0)