Skip to content

Commit 2ddd181

Browse files
authored
Merge branch 'master' into xdebug
2 parents 090aaf5 + f683231 commit 2ddd181

File tree

6 files changed

+40
-4
lines changed

6 files changed

+40
-4
lines changed

.run/Acceptance.run.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Acceptance" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
3+
<TestRunner bootstrap_file="$PROJECT_DIR$/tests/bootstrap.php" configuration_file="$PROJECT_DIR$/phpunit.xml.dist" directory="$PROJECT_DIR$/tests/Acceptance" scope="XML" options="--testsuite=Acceptance" />
4+
<method v="2" />
5+
</configuration>
6+
</component>

.run/Functional.run.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Functional" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
3+
<TestRunner bootstrap_file="$PROJECT_DIR$/tests/bootstrap.php" configuration_file="$PROJECT_DIR$/phpunit.xml.dist" directory="$PROJECT_DIR$/tests/Functional" scope="XML" options="--testsuite=Functional" />
4+
<method v="2" />
5+
</configuration>
6+
</component>

.run/Unit.run.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Unit" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
3+
<TestRunner bootstrap_file="$PROJECT_DIR$/tests/bootstrap.php" configuration_file="$PROJECT_DIR$/phpunit.xml.dist" directory="$PROJECT_DIR$/tests/Functional" scope="XML" options="--testsuite=Unit" />
4+
<method v="2" />
5+
</configuration>
6+
</component>

resources/.phpstorm.meta.php/.phpstorm.meta.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,8 @@
6262
override(\Temporal\Client\WorkflowClient::newRunningWorkflowStub(), map([
6363
'' => type(0),
6464
]));
65+
66+
override(\Temporal\Client\WorkflowStubInterface::getResult(), map([
67+
'' => '@',
68+
]));
6569
}

resources/workflow.meta-storm.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,11 @@
7474
<collection name="temporal/sdk:activity-class" argument="0" />
7575
<stopCompletion />
7676
</classMethod>
77+
<classMethod
78+
class="\Temporal\Workflow\WorkflowRunInterface"
79+
method="getResult"
80+
argument="0">
81+
<languageInjection language="InjectablePHP" prefix="/** @var " suffix="$_ **/" />
82+
</classMethod>
7783
</definitions>
7884
</meta-storm>

testing/src/Environment.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,18 @@ public function startTemporalServer(
101101
);
102102
$this->temporalServerProcess->setTimeout($commandTimeout);
103103
$this->temporalServerProcess->start();
104-
$this->output->writeln('<info>done.</info>');
105-
\sleep(1);
104+
105+
$limit = 1_000_000;
106+
while (!$this->temporalServerProcess->isRunning() && $limit > 0) {
107+
\usleep($limit -= 1000);
108+
}
106109

107110
if (!$this->temporalServerProcess->isRunning()) {
108111
$this->output->writeln('<error>error</error>');
109112
$this->output->writeln('Error starting Temporal server: ' . $this->temporalServerProcess->getErrorOutput());
110113
exit(1);
111114
}
115+
$this->output->writeln('<info>done.</info>');
112116
}
113117

114118
public function startTemporalTestServer(int $commandTimeout = 10): void
@@ -127,14 +131,18 @@ public function startTemporalTestServer(int $commandTimeout = 10): void
127131
);
128132
$this->temporalTestServerProcess->setTimeout($commandTimeout);
129133
$this->temporalTestServerProcess->start();
130-
$this->output->writeln('<info>done.</info>');
131-
\sleep(1);
134+
135+
$limit = 1_000_000;
136+
while (!$this->temporalTestServerProcess->isRunning() && $limit > 0) {
137+
\usleep($limit -= 1000);
138+
}
132139

133140
if (!$this->temporalTestServerProcess->isRunning()) {
134141
$this->output->writeln('<error>error</error>');
135142
$this->output->writeln('Error starting Temporal Test server: ' . $this->temporalTestServerProcess->getErrorOutput());
136143
exit(1);
137144
}
145+
$this->output->writeln('<info>done.</info>');
138146
}
139147

140148
/**

0 commit comments

Comments
 (0)