Skip to content

Commit

Permalink
Add canary-test make target to test beta fleet mailservers. Closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Pombeiro committed Nov 19, 2018
1 parent 5b2d7dc commit 51cc7d5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -18,6 +18,9 @@ jobs:
- stage: Test e2e on private network
script:
- make test-e2e-race
- stage: Test with deployed mailservers
script:
- make canary-test
cache:
directories:
- ".ethereumtest/Mainnet"
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -279,6 +279,9 @@ test-e2e: ##@tests Run e2e tests
test-e2e-race: gotest_extraflags=-race
test-e2e-race: test-e2e ##@tests Run e2e tests with -race flag

canary-test: node-canary
_assets/scripts/canary_test_mailservers.sh ./config/cli/fleet-eth.beta.json

lint-install:
@# The following installs a specific version of golangci-lint, which is appropriate for a CI server to avoid different results from build to build
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $(GOPATH)/bin v1.10.2
Expand Down
9 changes: 5 additions & 4 deletions _assets/ci/Jenkinsfile
Expand Up @@ -30,10 +30,11 @@ node('linux') {
println(gitSHA)
}

// TODO(adam): enable when unit tests start passing
// stage('Test') {
// sh 'make ci'
// }
stage('Test') {
// TODO(adam): enable when unit tests start passing
//sh 'make ci'
sh 'make canary-test'
}

stage('Build') {
sh 'go get github.com/status-im/xgo'
Expand Down
20 changes: 20 additions & 0 deletions _assets/scripts/canary_test_mailservers.sh
@@ -0,0 +1,20 @@
#!/bin/bash

json_path='.ClusterConfig.TrustedMailServers'
mailservers=$(jq -r "${json_path} | .[]" $1)
count=$(jq -r "${json_path} | length" $1)

echo "Will test ${count} mailservers..."
failed_count=0

while read -r mailserver; do
echo "Testing $mailserver ..."
./build/bin/node-canary -log=ERROR -log-without-color=true -mailserver $mailserver || failed_count=$((failed_count + 1))
done <<< "$mailservers"

if [ $failed_count -gt 0 ]; then
echo "${failed_count}/${count} mailservers failed the test"
exit 1
else
echo "All mailservers replied correctly"
fi
6 changes: 3 additions & 3 deletions _assets/scripts/install_deps.sh
@@ -1,13 +1,13 @@
#!/bin/bash

if [ -x "$(command -v apt)" ]; then
apt install -y protobuf-compiler
apt install -y protobuf-compiler jq
fi

if [ -x "$(command -v pacman)" ]; then
pacman -Sy protobuf --noconfirm
pacman -Sy protobuf jq --noconfirm
fi

if [ -x "$(command -v brew)" ]; then
brew install protobuf
brew install protobuf jq
fi

0 comments on commit 51cc7d5

Please sign in to comment.