Skip to content

Commit

Permalink
Use a single mosquitto in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lupine committed Mar 27, 2023
1 parent 8a1c081 commit 7876fea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ jobs:
command: test
args: --features=mocks

- name: Start Mosquitto
uses: namoshek/mosquitto-github-action@v1
with:
version: '1.6'

- name: Run integration tests
env:
CI_USE_EXTERNAL_MOSQUITTO: '1'
working-directory: integration_tests
run: bundle exec rspec
build:
Expand Down
5 changes: 5 additions & 0 deletions integration_tests/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

# Set up an MQTT server
config.around(:each) do |example|
if ENV['CI_USE_EXTERNAL_MOSQUITTO'] == '1'
example.run
next
end

name = "mosquitto-lxp-bridge-tests-#{Process.pid}"
Kernel.system(
*%W[docker run --detach --rm -p 1883:1883 -p 9001:9001 --name #{name} eclipse-mosquitto:1.6],
Expand Down

0 comments on commit 7876fea

Please sign in to comment.