made sure that skipping of the testcase uses the provided mechanisms

This commit is contained in:
Frank Elsinga 2024-10-04 03:28:54 +02:00
parent e97fd40b54
commit a6a662e751

View file

@ -5,11 +5,6 @@ const mqtt = require("mqtt");
const { MqttMonitorType } = require("../../server/monitor-types/mqtt");
const { UP, PENDING } = require("../../src/util");
if (!!process.env.CI && process.platform !== "linux" && process.arch !== "x64") {
console.log("testcontainers are not available in the github CI on non-linux or non-x64 platforms. Skipping");
return;
}
/**
* Runs an MQTT test with the
* @param {string} mqttSuccessMessage the message that the monitor expects
@ -56,7 +51,11 @@ async function testMqtt(mqttSuccessMessage, mqttCheckType, receivedMessage) {
return heartbeat;
}
describe("MqttMonitorType", { concurrency: true }, () => {
const isInCIWithRuntime = !!process.env.CI && process.platform === "linux" && process.arch === "x64";
describe("MqttMonitorType", {
concurrency: true,
skip: !process.env.CI || isInCIWithRuntime
}, () => {
test("valid keywords (type=default)", async () => {
const heartbeat = await testMqtt("KEYWORD", null, "-> KEYWORD <-");
assert.strictEqual(heartbeat.status, UP);