Skip to content

Commit

Permalink
Test integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
melaniekung committed Feb 7, 2025
1 parent e626e5c commit 9d91309
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- qa/**
- stable/**
- dev/integration-test-test
jobs:
integration-tests:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -114,7 +115,7 @@ jobs:
echo 'Print qubit_prod.log'
sudo tail ${{ github.workspace }}/log/qubit_prod.log
echo 'Print nginx/error.log'
sudo tail /var/log/nginx/error.log
sudo tail -n 30 /var/log/nginx/error.log
echo 'Print php8.3-fpm.log'
sudo tail /var/log/php8.3-fpm.log
- name: Upload Cypress Screenshots
Expand Down
19 changes: 19 additions & 0 deletions config/ProjectConfiguration.class.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
<?php
function prodlog($message = "", $value = "")
{
$logFile = "./log/qubit_prod.log";

if ($value != null) {
$logMessage = $message.": ";
if (is_string($value)) {
$logMessage .= $value;
} elseif (is_bool($value)) {
$logMessage .= $value ? 'true' : 'false';
} else {
$logMessage .= json_encode($value);
}
} else {
$logMessage =json_encode($message);
}

error_log("DEV LOG: " . $logMessage . "\n", 3, $logFile);
}

/*
* This file is part of the Access to Memory (AtoM) software.
Expand Down
1 change: 1 addition & 0 deletions lib/model/QubitJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ public static function runJob($jobName, $jobParams = [])

// Submit a non-blocking task to Gearman
$gmClient = new Net_Gearman_Client(arGearman::getServers());
prodlog('gearman servers', arGearman::getServers());
$gmClient->{$jobName}($jobParams);

return $job;
Expand Down
5 changes: 5 additions & 0 deletions vendor/net_gearman/Net/Gearman/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public function __construct($servers, $timeout = 1000)
throw new Net_Gearman_Exception('Invalid servers specified');
}

prodlog('servers',$servers);

$this->serverToSocket = array_flip($servers);
foreach ($this->serverToSocket as $server => $dummy) {
$conn = null;
Expand Down Expand Up @@ -279,6 +281,9 @@ protected function submitTask(Net_Gearman_Task $task)
);

$s = $this->getConnection($task->uniq);
prodlog('s', $s);
prodlog('type', $type);
prodlog('params', $params);
Net_Gearman_Connection::send($s, $type, $params);

$s_key = (int)$s;
Expand Down
1 change: 1 addition & 0 deletions vendor/net_gearman/Net/Gearman/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ public function status()
'capable_workers' => $capable
);
}
prodlog('status', $status);

return $status;
}
Expand Down

0 comments on commit 9d91309

Please sign in to comment.