Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-3245650
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-3245650
Commits
d1fc4f72
Commit
d1fc4f72
authored
3 years ago
by
Yas Naoi
Committed by
Yas Naoi
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3218525
by yas, Masami: Shorten the test time
parent
835ccbab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/cloud_service_providers/k8s/tests/src/Functional/cloud/server_template/CloudServerTemplateTest.php
+11
-2
11 additions, 2 deletions
...ctional/cloud/server_template/CloudServerTemplateTest.php
with
11 additions
and
2 deletions
modules/cloud_service_providers/k8s/tests/src/Functional/cloud/server_template/CloudServerTemplateTest.php
+
11
−
2
View file @
d1fc4f72
...
...
@@ -17,6 +17,7 @@ class CloudServerTemplateTest extends K8sTestBase {
use
CloudServerTemplateTrait
;
public
const
CLOUD_SERVER_TEMPLATES_REPEAT_COUNT
=
2
;
public
const
CLOUD_SERVER_TEMPLATES_MAX_OBJECT_COUNT
=
10
;
private
const
CLOUD_SERVER_TEMPLATES_OPERATION_ADD
=
'add'
;
private
const
CLOUD_SERVER_TEMPLATES_OPERATION_EDIT
=
'edit'
;
...
...
@@ -280,12 +281,21 @@ class CloudServerTemplateTest extends K8sTestBase {
*
* @throws \Behat\Mink\Exception\ExpectationException
* @throws \Behat\Mink\Exception\ResponseTextException
* @throws \Exception
*/
private
function
runServerTemplateLaunchTest
():
void
{
$cloud_context
=
$this
->
cloudContext
;
$objects
=
\Drupal
::
service
(
'k8s'
)
->
supportedCloudServerTemplates
();
// Pick up several $objects randomly to shorten the test time.
$objects
=
array_intersect_key
(
$objects
,
array_flip
(
array_rand
(
$objects
,
random_int
(
2
,
self
::
CLOUD_SERVER_TEMPLATES_MAX_OBJECT_COUNT
)
)
));
foreach
(
$objects
as
$object
=>
$name
)
{
$count
=
random_int
(
1
,
self
::
CLOUD_SERVER_TEMPLATES_REPEAT_COUNT
);
$createFormDataFunction
=
"create
{
$name
}
TestFormData"
;
if
(
!
method_exists
(
$this
,
$createFormDataFunction
))
{
...
...
@@ -459,7 +469,6 @@ class CloudServerTemplateTest extends K8sTestBase {
}
$this
->
assertSession
()
->
linkNotExists
(
$this
->
namespaces
[
0
]);
$this
->
assertSession
()
->
linkExists
(
$this
->
namespaces
[
1
]);
}
}
}
...
...
@@ -787,8 +796,8 @@ class CloudServerTemplateTest extends K8sTestBase {
}
$mock_data
[
'getNamespaces'
][]
=
$namespace
;
}
parent
::
updateMockDataToConfig
(
$mock_data
);
parent
::
updateMockDataToConfig
(
$mock_data
);
}
}
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