Skip to content

Commit 92290fb

Browse files
authored
Fix: Local test setup uses port 1884 for MQTT with authentication (#127)
* Use port 1884 for MQTT with authentication (also locally) * Update the command for a local dev Mosquitto in README * Wait longer in CI builds until broker has started * Upgrade HiveMQ in CI build to v4.8.5
1 parent 0321e8b commit 92290fb

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
if: matrix.mqtt-broker == 'hivemq'
9393
uses: Namoshek/hivemq4-github-action@v1
9494
with:
95-
version: '4.4.4'
95+
version: '4.8.5'
9696
ports: '1883:1883 8883:8883 8884:8884'
9797
certificates: ${{ github.workspace }}/.ci/tls
9898
config: ${{ github.workspace }}/.ci/hivemq.xml

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,15 @@ This will create all required certificates in the `.ci/tls/` directory. The same
284284

285285
Running the tests expects an MQTT broker to be running. The easiest way to run an MQTT broker is through Docker:
286286
```sh
287-
docker run --rm -it -p 1883:1883 -p 8883:8883 -p 8884:8884 -v $(pwd)/.ci/tls:/mosquitto-certs -v $(pwd)/.ci/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto:1.6
287+
docker run --rm -it \
288+
-p 1883:1883 \
289+
-p 1884:1884 \
290+
-p 8883:8883 \
291+
-p 8884:8884 \
292+
-v $(pwd)/.ci/tls:/mosquitto-certs \
293+
-v $(pwd)/.ci/mosquitto.conf:/mosquitto/config/mosquitto.conf \
294+
-v $(pwd)/.ci/mosquitto.passwd:/mosquitto/config/mosquitto.passwd \
295+
eclipse-mosquitto:1.6
288296
```
289297
When run from the project directory, this will spawn a Mosquitto MQTT broker configured with the generated TLS certificates and a custom configuration.
290298

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<php>
1313
<env name="MQTT_BROKER_HOST" value="localhost"/>
1414
<env name="MQTT_BROKER_PORT" value="1883"/>
15-
<env name="MQTT_BROKER_PORT_WITH_AUTHENTICATION" value="1883"/>
15+
<env name="MQTT_BROKER_PORT_WITH_AUTHENTICATION" value="1884"/>
1616
<env name="MQTT_BROKER_TLS_PORT" value="8883"/>
1717
<env name="MQTT_BROKER_TLS_WITH_CLIENT_CERT_PORT" value="8884"/>
1818
<env name="TLS_CERT_DIR" value=".ci/tls"/>

0 commit comments

Comments
 (0)