Skip to content

Commit

Permalink
Merge pull request #316 from kafkaex/add_credo
Browse files Browse the repository at this point in the history
Add credo to CI tests
  • Loading branch information
joshuawscott authored Dec 7, 2018
2 parents f194d29 + 310cd47 commit 1496344
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ matrix:
otp_release: 20.2
- elixir: 1.4.5
otp_release: 19.3
env: COVERALLS=true
env: COVERALLS=true CREDO=true
- elixir: 1.3.4
otp_release: 19.3
- elixir: 1.2.6
Expand All @@ -28,7 +28,9 @@ sudo: required
services:
- docker
env:
- COVERALLS=false
global:
- COVERALLS=false
- CREDO=false
before_script:
- IP_IFACE=eth0 ./scripts/docker_up.sh
script:
Expand Down
22 changes: 10 additions & 12 deletions scripts/ci_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
#
# This script could be used for local testing as long as COVERALLS is not set.

set -ex

export MIX_ENV=test

if [ "$CREDO" = true ]
then
MIX_ENV=dev mix credo
fi

if [ "$COVERALLS" = true ]
then
echo "Coveralls will be reported"
Expand All @@ -16,16 +23,7 @@ else
TEST_COMMAND=test
fi

INCLUDED_TESTS="--include integration --include consumer_group --include server_0_p_10_and_later --include server_0_p_9_p_0 --include server_0_p_8_p_0"
INCLUDED_TESTS="--include integration --include consumer_group --include server_0_p_10_and_later --include server_0_p_9_p_0 --include server_0_p_8_p_0"

mix "$TEST_COMMAND" $INCLUDED_TESTS

# sometimes the first test run fails due to broker issues and we need to run it again
# (we should strive to remove this but it is necessary for now)
if [ $? -eq 0 ]
then
echo "First tests passed, skipping repeat"
else
echo "Repeating tests"
mix "$TEST_COMMAND" $INCLUDED_TESTS
fi
# Retry if it doesn't work the first time
mix "$TEST_COMMAND" $INCLUDED_TESTS || mix "$TEST_COMMAND" $INCLUDED_TESTS
4 changes: 2 additions & 2 deletions test/integration/server0_p_8_p_0_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule KafkaEx.Server0P8P0.Test do
@topic,
partition,
worker_name: worker,
offset: 1,
offset: 0,
auto_commit: false
)
[got_partition] = got.partitions
Expand All @@ -61,7 +61,7 @@ defmodule KafkaEx.Server0P8P0.Test do
@topic,
partition,
worker_name: worker,
offset: 1,
offset: 0,
auto_commit: false
)
end
Expand Down

0 comments on commit 1496344

Please sign in to comment.