mirror of
https://github.com/internetee/epp_proxy.git
synced 2025-08-22 07:00:47 +02:00
Test in container (#52)
* Dockerfile for tests * Show test coverage * Removal of old test pipeline Co-authored-by: Alex Sherman <yul.golem@gmail.com>
This commit is contained in:
parent
07b6eb3bdb
commit
24b6c68682
3 changed files with 37 additions and 38 deletions
38
.github/workflows/erlang.yml
vendored
38
.github/workflows/erlang.yml
vendored
|
@ -1,38 +0,0 @@
|
||||||
name: Erlang CI
|
|
||||||
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: OTP ${{matrix.otp}}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
otp: [21.3.8.17]
|
|
||||||
ruby: [2.6.3]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.0.0
|
|
||||||
- uses: gleam-lang/setup-erlang@v1.1.2
|
|
||||||
with:
|
|
||||||
otp-version: ${{matrix.otp}}
|
|
||||||
- uses: ruby/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby }}
|
|
||||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
||||||
|
|
||||||
- name: Install rebar dependencies
|
|
||||||
run: rebar3 as test get-deps
|
|
||||||
|
|
||||||
- name: Integrated Ruby app setup
|
|
||||||
run: |
|
|
||||||
rebar3 as test get-deps
|
|
||||||
/bin/bash -l -c "cd apps/epp_proxy/priv/test_backend_app && bundle install"
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
/bin/bash -l -c "cd apps/epp_proxy/priv/test_backend_app && bundle exec rackup --pid pidfile -D"
|
|
||||||
rebar3 as test compile
|
|
||||||
DEBUG=1 rebar3 ct --sys_config config/test.config --readable=false --cover --verbose=true
|
|
||||||
rebar3 cover --verbose
|
|
||||||
|
|
||||||
# - run: rebar3 eunit
|
|
33
.github/workflows/run-automatest-tests.yml
vendored
Normal file
33
.github/workflows/run-automatest-tests.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
name: Proxy automated tests
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.0.0
|
||||||
|
|
||||||
|
- name: Build image for tests
|
||||||
|
run: docker build -t proxy-tester -f Dockerfile.test .
|
||||||
|
|
||||||
|
- name: Start the container
|
||||||
|
run: docker run -d --name tester proxy-tester
|
||||||
|
|
||||||
|
- name: Install rebar dependencies
|
||||||
|
run: docker exec -i tester rebar3 as test get-deps
|
||||||
|
|
||||||
|
- name: Integrated Ruby app setup
|
||||||
|
run: docker exec -d tester bash -l -c "cd apps/epp_proxy/priv/test_backend_app && bundle install && bundle exec rackup"
|
||||||
|
|
||||||
|
- name: Compile for tests
|
||||||
|
run: |
|
||||||
|
sleep 15
|
||||||
|
docker exec -i tester rebar3 as test compile
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
docker exec -i -e DEBUG=1 tester rebar3 ct --sys_config config/test.config --readable=false --cover --verbose=true
|
||||||
|
|
||||||
|
- name: Show test coverage
|
||||||
|
run: docker exec -i tester rebar3 cover --verbose
|
4
Dockerfile.test
Normal file
4
Dockerfile.test
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
FROM internetee/erlang-ruby:21.3.8-2.6.3
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
CMD ["tail", "-f" , "/dev/null"]
|
Loading…
Add table
Add a link
Reference in a new issue