Skip to content

Commit

Permalink
Merge pull request #135 from esl/reworking-ci
Browse files Browse the repository at this point in the history
switching from TravisCI to GH Actions
  • Loading branch information
chrzaszcz authored Nov 27, 2020
2 parents c44b00b + e36a7a9 commit a83947b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 31 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ jobs:
strategy:
matrix:
otp: ['22.3', '21.3']
test-type: [ 'regular' , 'integration' ]
test-type: [ 'regular', 'integration' ]
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: ErlGang/setup-erlang@v1.0.0
with:
otp-version: ${{ matrix.otp }}
- if: matrix.test-type == 'regular'
run: make test
- if: matrix.test-type == 'integration'
run: make integration_test
env:
TRAVIS_OTP_RELEASE: ${{ matrix.otp }}
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# A Murder of Crows [![Build Status](https://travis-ci.org/esl/amoc.svg?branch=master)](https://travis-ci.org/esl/amoc)
# A Murder of Crows [![](https://github.com/esl/amoc/workflows/CI/badge.svg)](https://github.com/esl/amoc/actions?query=workflow%3ACI)

----------------------------------------------------------------------------------------------
A Murder of Crows, aka amoc, is a simple framework for running massively parallel tests in a distributed environment.
Expand Down
16 changes: 12 additions & 4 deletions integration_test/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function start_graphite_container() {
function amoc_container_port() {
local container="$1"
if [[ "$container" =~ ^amoc-[0-9]$ ]]; then
echo "808${container#amoc-}"
echo "888${container#amoc-}"
else
return 1
fi
Expand All @@ -54,7 +54,7 @@ function start_amoc_container() {
local name="$1"
shift 1
local port="$(amoc_container_port "$name")"
docker run --rm -t -d --name "$name" -h "$name" \
docker run --rm -d --name "$name" -h "$name" \
--network "$docker_network" \
-e AMOC_GRAPHITE_HOST='"graphite"' \
--health-cmd="/home/amoc/amoc/bin/amoc status" \
Expand All @@ -67,15 +67,17 @@ function amoc_eval() {
local exec_path="/home/amoc/amoc/bin/amoc"
local container="$1"
shift 1
docker exec -it "$container" "$exec_path" eval "$@"
docker exec "$container" "$exec_path" eval "$@"
}

function get_health_status() {
docker inspect --format '{{json .State.Health.Status }}' "$1"
}

function container_is_healthy() {
[ "$(get_health_status "$1")" = "\"healthy\"" ]
local health_status="$(get_health_status "$1")"
#echo "$1 container health status == '${health_status}'"
[ "$health_status" = "\"healthy\"" ]
}

function wait_for_healthcheck() {
Expand Down Expand Up @@ -111,6 +113,12 @@ function wait_for_cmd() {
return 1
}

function get_amoc_logs() {
local logs_path="/home/amoc/amoc/log/erlang.log"
local container="$1"
docker exec "$container" cat "$logs_path"
}

######################
## common variables ##
######################
Expand Down
2 changes: 1 addition & 1 deletion integration_test/test_add_new_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ wait_for_healthcheck amoc-4

amoc_eval amoc-4 "amoc_controller:get_status()" | contain dummy_scenario running
amoc_eval amoc-4 "amoc_config:get(test)" | contain "test_value"
amoc_eval amoc-4 "dummy_helper:test_amoc_dist()" | tee /dev/tty | contain 'amoc_dist_works_as_expected'
amoc_eval amoc-4 "dummy_helper:test_amoc_dist()" | contain 'amoc_dist_works_as_expected'

0 comments on commit a83947b

Please sign in to comment.