From 07703f1a163812f4e1ce935cca3a5f4bbb6d3c3e Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 7 Apr 2022 13:25:29 +0200 Subject: [PATCH] Enable unit tests on CI --- .github/workflows/ci.yaml | 20 +++++++++++++++++++- config/hdm.yml.template | 2 +- test/test_helper.rb | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 41337e5e..f1a3a36e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,6 @@ jobs: runs-on: ubuntu-latest env: BUNDLE_WITHOUT: development:test - steps: - uses: actions/checkout@v2 - name: Set up Ruby @@ -29,3 +28,22 @@ jobs: bundler-cache: true - name: Run tests run: bundle exec rake rubocop + unit_tests: + name: Unit tests + runs-on: ubuntu-latest + env: + COVERAGE: true + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Setup config + run: mv config/hdm.yml{.template,} + - name: Install webpacker + run: bundle exec rake webpacker:install + - name: Generate assets + run: bundle exec rake webpacker:compile + - name: Run tests + run: bundle exec rake test:all diff --git a/config/hdm.yml.template b/config/hdm.yml.template index cdaac28c..cc1563f8 100644 --- a/config/hdm.yml.template +++ b/config/hdm.yml.template @@ -10,7 +10,7 @@ test: read_only: false allow_encryption: true puppet_db: - server: "http://localhost:8084" + server: "http://localhost:8085" config_dir: <%= Rails.root.join('test','fixtures','files','puppet') %> #hiera_config_file: "hiera_hdm.yaml" diff --git a/test/test_helper.rb b/test/test_helper.rb index 00edb049..76ff700d 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -13,7 +13,7 @@ # Start FakePuppetDB-Server server_thread = Thread.new do - Rack::Server.start(app: FakePuppetDB.new, Host: "localhost", Port: 8084) + Rack::Server.start(app: FakePuppetDB.new, Host: "localhost", Port: 8085) end server_thread.join(1)