Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cucumber_ui
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
cucumber_ui
Commits
e51662fa
Commit
e51662fa
authored
1 year ago
by
Tasneem Natshah
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3380447
: Update the "Run cucumber tests" execution for all features saved by the user
parent
adae2d88
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Controller/CucumberUiController.php
+5
-5
5 additions, 5 deletions
src/Controller/CucumberUiController.php
src/Form/CucumberUiRunTests.php
+20
-20
20 additions, 20 deletions
src/Form/CucumberUiRunTests.php
src/Form/CucumberUiSettings.php
+1
-1
1 addition, 1 deletion
src/Form/CucumberUiSettings.php
with
26 additions
and
26 deletions
src/Controller/CucumberUiController.php
+
5
−
5
View file @
e51662fa
...
...
@@ -172,8 +172,8 @@ class CucumberUiController extends ControllerBase
$report_url
=
new
Url
(
'cucumber_ui.report'
);
$output
=
'<iframe id="cucumber-ui-output-iframe" src="'
.
$this
->
currentRequest
->
getSchemeAndHttpHost
()
.
$report_url
->
toString
()
.
'" width="100%" height="100%"></iframe>'
;
$
beaht
_ui_tempstore_collection
=
$this
->
tempStore
->
get
(
'cucumber_ui'
);
$pid
=
$
beaht
_ui_tempstore_collection
->
get
(
'cucumber_ui_pid'
);
$
cucumber
_ui_tempstore_collection
=
$this
->
tempStore
->
get
(
'cucumber_ui'
);
$pid
=
$
cucumber
_ui_tempstore_collection
->
get
(
'cucumber_ui_pid'
);
if
(
$pid
&&
posix_kill
(
intval
(
$pid
),
0
))
{
...
...
@@ -231,13 +231,13 @@ class CucumberUiController extends ControllerBase
public
function
kill
()
{
$response
=
false
;
$
beaht
_ui_tempstore_collection
=
$this
->
tempStore
->
get
(
'cucumber_ui'
);
$pid
=
$
beaht
_ui_tempstore_collection
->
get
(
'cucumber_ui_pid'
);
$
cucumber
_ui_tempstore_collection
=
$this
->
tempStore
->
get
(
'cucumber_ui'
);
$pid
=
$
cucumber
_ui_tempstore_collection
->
get
(
'cucumber_ui_pid'
);
if
(
$pid
&&
posix_kill
(
intval
(
$pid
),
0
))
{
try
{
$response
=
posix_kill
(
$pid
,
SIGKILL
);
$
beaht
_ui_tempstore_collection
->
delete
(
'cucumber_ui_pid'
);
$
cucumber
_ui_tempstore_collection
->
delete
(
'cucumber_ui_pid'
);
}
catch
(
Exception
$e
)
{
$response
=
false
;
...
...
This diff is collapsed.
Click to expand it.
src/Form/CucumberUiRunTests.php
+
20
−
20
View file @
e51662fa
...
...
@@ -123,8 +123,8 @@ class CucumberUiRunTests extends FormBase
$html_report_dir
=
$config
->
get
(
'html_report_dir'
);
$log_report_dir
=
$config
->
get
(
'log_report_dir'
);
$
beaht
_ui_tempstore_collection
=
$this
->
tempStore
->
get
(
'cucumber_ui'
);
$pid
=
$
beaht
_ui_tempstore_collection
->
get
(
'cucumber_ui_pid'
);
$
cucumber
_ui_tempstore_collection
=
$this
->
tempStore
->
get
(
'cucumber_ui'
);
$pid
=
$
cucumber
_ui_tempstore_collection
->
get
(
'cucumber_ui_pid'
);
$label
=
$this
->
t
(
'Not running'
);
$class
=
''
;
...
...
@@ -229,8 +229,8 @@ class CucumberUiRunTests extends FormBase
$log_report_dir
=
$config
->
get
(
'log_report_dir'
);
$
beaht
_ui_tempstore_collection
=
$this
->
tempStore
->
get
(
'cucumber_ui'
);
$pid
=
$
beaht
_ui_tempstore_collection
->
get
(
'cucumber_ui_pid'
);
$
cucumber
_ui_tempstore_collection
=
$this
->
tempStore
->
get
(
'cucumber_ui'
);
$pid
=
$
cucumber
_ui_tempstore_collection
->
get
(
'cucumber_ui_pid'
);
$command
=
''
;
...
...
@@ -292,22 +292,22 @@ class CucumberUiRunTests extends FormBase
}
$command
.
=
';'
;
$process
=
new
Process
(
$command
);
$process
->
enableOutput
();
try
{
$process
->
start
();
$new_pid
=
$process
->
getPid
()
+
1
;
$this
->
messenger
->
addMessage
(
$this
->
t
(
"Started running tests using prcess ID: @pid"
,
[
"@pid"
=>
$new_pid
]));
$
beaht
_ui_tempstore_collection
->
set
(
'cucumber_ui_pid'
,
$new_pid
);
if
(
!
$process
->
isSuccessful
())
{
$this
->
messenger
->
addMessage
(
$process
->
getErrorOutput
());
}
}
catch
(
ProcessFailedException
$exception
)
{
$form_state
->
setErrorByName
(
'submit_button'
,
$exception
->
getMessage
());
}
//
$process = new Process($command);
//
$process->enableOutput();
//
try {
//
$process->start();
//
$new_pid = $process->getPid() + 1;
//
$this->messenger->addMessage($this->t("Started running tests using prcess ID: @pid", ["@pid" => $new_pid]));
//
$
cucumber
_ui_tempstore_collection->set('cucumber_ui_pid', $new_pid);
//
if (!$process->isSuccessful()) {
//
$this->messenger->addMessage($process->getErrorOutput());
//
}
//
}
//
catch (ProcessFailedException $exception) {
//
$form_state->setErrorByName('submit_button', $exception->getMessage());
//
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/Form/CucumberUiSettings.php
+
1
−
1
View file @
e51662fa
...
...
@@ -162,7 +162,7 @@ class CucumberUiSettings extends ConfigFormBase
<div class="panel">
<h3 class="panel__title">'
.
$this
->
t
(
'Editing Mode'
)
.
'</h3>
<div class="panel__content">'
,
'#suffix'
=>
'</div></div></div>'
,
'#suffix'
=>
'</div></div></div>
</div>
'
,
];
return
parent
::
buildForm
(
$form
,
$form_state
);
...
...
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