Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-3255212
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
cloud-3255212
Commits
49760f55
Commit
49760f55
authored
3 years ago
by
Kumiko Ono
Committed by
Yas Naoi
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3254463
by kumikoono, yas: Support random string in preprocessing Behat test feature files
parent
df5ee177
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/cloud_service_providers/aws_cloud/tests/src/Behat/behat_params.yml
+13
-12
13 additions, 12 deletions
...vice_providers/aws_cloud/tests/src/Behat/behat_params.yml
src/Commands/BehatCommands.php
+3
-3
3 additions, 3 deletions
src/Commands/BehatCommands.php
with
16 additions
and
15 deletions
modules/cloud_service_providers/aws_cloud/tests/src/Behat/behat_params.yml
+
13
−
12
View file @
49760f55
# This file is processed by drush cloud:behat:preprocess.
# '
_r
andom
_
' is a reserved term to be replaced by a random string
in lowercase
.
# '
_R
andom
_
' is in
mixed
cases, and '
_
RANDOM
_
' is in uppercase.
# '
@R
andom' is a reserved term to be replaced by a random string.
# '
@r
andom' is in
lower
cases, and '
@
RANDOM' is in uppercase.
account_id
:
# Need to set your AWS account id.
...
...
@@ -8,11 +8,12 @@ account_id:
avail_zone
:
us-west-1a
cloud_context
:
bdd_random_aws_us_west_1
# The region is automatically set as suffix.
bdd_aws_@random_us_west_1
cloud_service_provider_name_entered
:
BDD_Random
_AWS
BDD_
AWS_@
Random
cloud_service_provider_name
:
BDD_Random
_AWS
(N. California)
BDD_
AWS_@
Random (N. California)
description
:
Created by behat
image_id
:
...
...
@@ -30,20 +31,20 @@ region_code:
region_name
:
US West (N. California)
role_name
:
BDD_Random
_Role
BDD_R
ole_@R
andom
role_name_machine
:
bdd_random
_role
bdd_r
ole_@r
andom
security_group_name
:
BDD_Random
_SG
BDD_
SG_@
Random
ssh_key_name
:
BDD_Random
_Key
BDD_
Key_@
Random
status
:
Review
subnet_name
:
BDD_
Random_Subnet
BDD_
Subnet_@Random
instance_name
:
BDD_
Random_
Instance
BDD_Instance
_@Random
vpc_name
:
BDD_Random
_VPC
BDD_
VPC_@
Random
wait
:
500
This diff is collapsed.
Click to expand it.
src/Commands/BehatCommands.php
+
3
−
3
View file @
49760f55
...
...
@@ -152,11 +152,11 @@ class BehatCommands extends DrushCommands implements BehatCommandsInterface {
private
function
randomizeName
(
array
&
$params
):
void
{
$random
=
(
new
Random
())
->
name
(
self
::
RANDOM_NAME_LENGTH
);
foreach
(
$params
as
$key
=>
$value
)
{
if
(
preg_match
(
'/(^.*
_
)(random)(
_
.*$)/i'
,
$value
,
$matches
))
{
if
(
$matches
[
2
]
===
'random'
)
{
if
(
preg_match
(
'/(^.*)(
@
random)(.*$)/i'
,
$value
,
$matches
))
{
if
(
$matches
[
2
]
===
'
@
random'
)
{
$rand
=
strtolower
(
$random
);
}
elseif
(
$matches
[
2
]
===
'RANDOM'
)
{
elseif
(
$matches
[
2
]
===
'
@
RANDOM'
)
{
$rand
=
strtoupper
(
$random
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment