Skip to content

Commit 41c2fb1

Browse files
committed
Test integration tests
1 parent 60027de commit 41c2fb1

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- qa/**
77
- stable/**
8+
- dev/integration-test-test
89
jobs:
910
integration-tests:
1011
runs-on: ubuntu-24.04

lib/model/QubitJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ private static function checkWorkerAvailable($jobName)
395395
$status = $manager->status();
396396

397397
if (!array_key_exists($jobName, $status) || !$status[$jobName]['capable_workers']) {
398-
return false;
398+
throw new Net_Gearman_Exception($jobName . " -> " . print_r(array_keys($status)));
399399
}
400400

401401
return true;

vendor/net_gearman/Net/Gearman/Manager.php

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
<?php
2+
function dockl($message = "", $value = "")
3+
{
4+
if ($value != null) {
5+
file_put_contents('php://stdout', $message.": ");
6+
if (is_string($value)) {
7+
file_put_contents('php://stdout', $value);
8+
} else if (is_bool($value)) {
9+
file_put_contents('php://stdout', $value ? 'true' : 'false');
10+
} else {
11+
file_put_contents('php://stdout', json_encode($value));
12+
}
13+
} else {
14+
file_put_contents('php://stdout', json_encode($message));
15+
}
16+
$linebreak = "\n";
17+
file_put_contents('php://stdout', $linebreak);
18+
}
219

320
/**
421
* Interface for Danga's Gearman job scheduling system
@@ -217,20 +234,22 @@ public function status()
217234
$this->sendCommand('status');
218235
$res = $this->recvCommand();
219236

220-
$status = array();
221-
$tmp = explode("\n", $res);
237+
$status = [];
238+
$tmp = explode("\n", $res);
222239
foreach ($tmp as $t) {
223240
if (!Net_Gearman_Connection::stringLength($t)) {
224241
continue;
225242
}
226243

227-
list($func, $inQueue, $jobsRunning, $capable) = explode("\t", $t);
244+
[$func, $inQueue, $jobsRunning, $capable] = explode("\t", $t);
228245

229-
$status[$func] = array(
246+
$status[$func] = [
230247
'in_queue' => $inQueue,
231248
'jobs_running' => $jobsRunning,
232249
'capable_workers' => $capable
233-
);
250+
];
251+
252+
dockl($status[$func]);
234253
}
235254

236255
return $status;

0 commit comments

Comments
 (0)