mirror of https://github.com/MISP/MISP
fix: disable background workers for tests
parent
f5babe9345
commit
e72f664319
|
@ -533,7 +533,7 @@ class GalaxyClustersController extends AppController
|
|||
|
||||
if ($this->request->is('post') || $this->request->is('put')) {
|
||||
$success = $this->GalaxyClusters->publishRouter($this->ACL->getUser()->toArray(), $cluster, $passAlong = null);
|
||||
if (Configure::read('MISP.BackgroundJobs.enabled')) {
|
||||
if (Configure::read('BackgroundJobs.enabled')) {
|
||||
$message = __('Publish job queued. Job ID: %s', $success);
|
||||
$this->Flash->success($message);
|
||||
if ($this->ParamHandler->isRest()) {
|
||||
|
|
|
@ -534,7 +534,7 @@ class GalaxyClustersTable extends AppTable
|
|||
*/
|
||||
public function publishRouter(array $user, $cluster, $passAlong = null)
|
||||
{
|
||||
if (Configure::read('MISP.BackgroundJobs.enabled')) {
|
||||
if (Configure::read('BackgroundJobs.enabled')) {
|
||||
if (is_numeric($cluster)) {
|
||||
$clusterId = $cluster;
|
||||
} elseif (isset($cluster['GalaxyCluster'])) {
|
||||
|
|
|
@ -34,6 +34,7 @@ class UpdateGalaxiesApiTest extends TestCase
|
|||
|
||||
$this->setAuthToken(AuthKeysFixture::ADMIN_API_KEY);
|
||||
|
||||
Configure::write('BackgroundJobs.enabled', false);
|
||||
Configure::write('MISP.custom_galaxies_path', '/var/www/html/tests/Libraries/misp-galaxy/galaxies/*.json');
|
||||
Configure::write('MISP.custom_galaxy_clusters_path', '/var/www/html/tests/Libraries/misp-galaxy/clusters/*.json');
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace App\Test\TestCase\Api\GalaxyClusters;
|
|||
use App\Test\Fixture\AuthKeysFixture;
|
||||
use App\Test\Fixture\GalaxyClustersFixture;
|
||||
use App\Test\Helper\ApiTestTrait;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\TestSuite\TestCase;
|
||||
|
||||
class PublishGalaxyClusterApiTest extends TestCase
|
||||
|
@ -32,6 +33,8 @@ class PublishGalaxyClusterApiTest extends TestCase
|
|||
{
|
||||
$this->skipOpenApiValidations();
|
||||
|
||||
Configure::write('BackgroundJobs.enabled', false);
|
||||
|
||||
$this->setAuthToken(AuthKeysFixture::ADMIN_API_KEY);
|
||||
|
||||
$this->assertDbRecordExists(
|
||||
|
|
Loading…
Reference in New Issue