Set TESTS_MQTT_BROKER_HOST globally for all jobs with mosquitto services (#989)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
This commit is contained in:
@@ -16,9 +16,9 @@ export async function createTestMock(): Promise<mqtt.MqttClient> {
|
||||
return mqttClient
|
||||
}
|
||||
|
||||
// Use MQTT_BROKER_HOST from environment, default to localhost
|
||||
const brokerHost = process.env.MQTT_BROKER_HOST || '127.0.0.1'
|
||||
const brokerPort = process.env.MQTT_BROKER_PORT || '1883'
|
||||
// Use TESTS_MQTT_BROKER_HOST from environment, default to localhost
|
||||
const brokerHost = process.env.TESTS_MQTT_BROKER_HOST || '127.0.0.1'
|
||||
const brokerPort = process.env.TESTS_MQTT_BROKER_PORT || '1883'
|
||||
const brokerUrl = `mqtt://${brokerHost}:${brokerPort}`
|
||||
|
||||
console.log(`Connecting to MQTT broker at ${brokerUrl}`)
|
||||
|
||||
@@ -32,7 +32,7 @@ import type { MqttClient } from 'mqtt'
|
||||
* - Handle MQTT asynchronous operations properly
|
||||
*
|
||||
* Prerequisites:
|
||||
* - MQTT broker running (default: localhost:1883, configurable via MQTT_BROKER_HOST and MQTT_BROKER_PORT)
|
||||
* - MQTT broker running (default: localhost:1883, configurable via TESTS_MQTT_BROKER_HOST and TESTS_MQTT_BROKER_PORT)
|
||||
* - Application built with `yarn build`
|
||||
*/
|
||||
// tslint:disable:only-arrow-functions ter-prefer-arrow-callback no-unused-expression
|
||||
@@ -125,8 +125,8 @@ describe('MQTT Explorer Comprehensive UI Tests', function () {
|
||||
page = await electronApp.firstWindow({ timeout: 30000 })
|
||||
await page.locator('//label[contains(text(), "Host")]/..//input').waitFor({ timeout: 10000 })
|
||||
|
||||
// Use MQTT_BROKER_HOST from environment, default to localhost
|
||||
const brokerHost = process.env.MQTT_BROKER_HOST || '127.0.0.1'
|
||||
// Use TESTS_MQTT_BROKER_HOST from environment, default to localhost
|
||||
const brokerHost = process.env.TESTS_MQTT_BROKER_HOST || '127.0.0.1'
|
||||
console.log(`Connecting to MQTT broker at ${brokerHost}...`)
|
||||
await connectTo(brokerHost, page)
|
||||
await sleep(3000) // Give time for all topics to load
|
||||
|
||||
@@ -134,7 +134,7 @@ describe('MQTT Explorer UI Tests', function () {
|
||||
}
|
||||
|
||||
console.log('Connecting to MQTT broker...')
|
||||
const brokerHost = process.env.MQTT_BROKER_HOST || '127.0.0.1'
|
||||
const brokerHost = process.env.TESTS_MQTT_BROKER_HOST || '127.0.0.1'
|
||||
await connectTo(brokerHost, page)
|
||||
await sleep(3000) // Give time for topics to load
|
||||
console.log('Setup complete')
|
||||
|
||||
Reference in New Issue
Block a user