Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"customizations": {
"vscode": {
"extensions": ["Orta.vscode-jest", "esbenp.prettier-vscode"],
"extensions": ["esbenp.prettier-vscode"],
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ jobs:
run: |
brew install docker docker-compose
brew install --cask rancher

TIMEOUT_SECS_CLI_TOOLS=60
TIMEOUT_SECS_USER_SOCKET=300

echo "Open Rancher Desktop app"
open "/Applications/Rancher Desktop.app"

echo "Wait max of ${TIMEOUT_SECS_CLI_TOOLS}s for Rancher Desktop to create CLI tools"
for i in $(seq 1 ${TIMEOUT_SECS_CLI_TOOLS}); do
if [ -e "$HOME/.rd/bin/rdctl" ]; then
Expand All @@ -85,12 +85,12 @@ jobs:
fi
sleep 1
done

if [ ! -e "$HOME/.rd/bin/rdctl" ]; then
echo "Rancher Desktop CLI tools not found"
exit 1
fi

echo "Rancher Desktop initialised successfully, now configure the container runtime"
$HOME/.rd/bin/rdctl set \
--container-engine.name=moby \
Expand All @@ -101,28 +101,28 @@ jobs:
--virtual-machine.number-cpus=3 \
--virtual-machine.memory-in-gb=14 \
|| true

echo "Restart Rancher Desktop"
$HOME/.rd/bin/rdctl shutdown
$HOME/.rd/bin/rdctl start

echo "Wait max of ${TIMEOUT_SECS_USER_SOCKET}s for Rancher socket"

for i in $(seq 1 ${TIMEOUT_SECS_USER_SOCKET}); do
if [ -e "$HOME/.rd/docker.sock" ]; then
echo "Rancher Desktop socket created after ${i}s"
break
fi
sleep 1
done

if [ ! -e "$HOME/.rd/docker.sock" ]; then
echo "Rancher Desktop socket not found"
exit 1
fi

echo "{}" > $HOME/.docker/config.json

echo "DOCKER_HOST=unix://${HOME}/.rd/docker.sock" >> $GITHUB_ENV
echo "TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock" >> $GITHUB_ENV
echo "NODE_OPTIONS=--dns-result-order=ipv4first" >> $GITHUB_ENV
Expand All @@ -139,4 +139,4 @@ jobs:
workspace: "${{ inputs.workspace }}"

- name: Run tests
run: npm run test:ci -- ${{ steps.npm-install.outputs.workspace_path }}
run: npm run test:ci -- --coverage.include=${{ steps.npm-install.outputs.workspace_path }} ${{ steps.npm-install.outputs.workspace_path }}
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"printWidth": 120
"printWidth": 120,
"plugins": [
"prettier-plugin-organize-imports"
]
}
14 changes: 8 additions & 6 deletions docs/modules/hivemq.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# HiveMQ MQTT Module

This module allows automatic start up of [HiveMQ's](https://www.hivemq.com/) docker container within
Jest suites, to enable programmatic testing of JavaScript based MQTT client applications.
test suites, to enable programmatic testing of JavaScript based MQTT client applications.

## Install

Expand All @@ -11,18 +11,20 @@ npm install @testcontainers/hivemq --save-dev

## Resources

* [Community forum](https://community.hivemq.com/)
* [HiveMQ website](https://www.hivemq.com/)
* [MQTT Essentials](https://www.hivemq.com/mqtt-essentials/)
* [MQTT 5 Essentials](https://www.hivemq.com/mqtt-5/)
- [Community forum](https://community.hivemq.com/)
- [HiveMQ website](https://www.hivemq.com/)
- [MQTT Essentials](https://www.hivemq.com/mqtt-essentials/)
- [MQTT 5 Essentials](https://www.hivemq.com/mqtt-5/)

Please make sure to check out the hivemq-docs for the [Community Edition](https://github.com/hivemq/hivemq-community-edition/wiki/).

!!! Info
We are working to support the HiveMQ Enterprise Edition as outlined in the [Java Test Containers Module](https://java.testcontainers.org/modules/hivemq/).
We are working to support the HiveMQ Enterprise Edition as outlined in the [Java Test Containers Module](https://java.testcontainers.org/modules/hivemq/).

## Examples

<!--codeinclude-->

[Connect with a mqtt.js client to HiveMQ](../../packages/modules/hivemq/src/hivemq-container.test.ts) inside_block:connect

<!--/codeinclude-->
7 changes: 0 additions & 7 deletions jest.config.ts

This file was deleted.

Loading