Skip to content

de-mystify tests & run them in parallel#1031

Merged
zramsay merged 32 commits intojenkinsfrom
tests-in-parallel
Jan 8, 2018
Merged

de-mystify tests & run them in parallel#1031
zramsay merged 32 commits intojenkinsfrom
tests-in-parallel

Conversation

@zramsay
Copy link
Contributor

@zramsay zramsay commented Dec 29, 2017

reduces the reliance on bash scripts (see tendermint/coding#45) by putting various test pathways as make targets. This let's us use circle's parallelism feature to shorten test time and prepares for move to jenkins

Makefile Outdated
# run the go unit tests with coverage (in docker)
docker run --name run_test -t tester bash test/test_cover.sh

test_cover_ci:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the *_ci suffix is temporary and replaces some logic in the test.sh file. The won't be necessary when jenkins is setup

@echo "--> Installing tools"
go get -u -v $(GOTOOLS)
@gometalinter.v2 --install
#@gometalinter.v2 --install
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

punt the linter until jenkins

circle.yml Outdated
test:
override:
- cd "$PROJECT_PATH" && set -o pipefail && make test_integrations 2>&1 | tee test_integrations.log:
- case ${CIRCLE_NODE_INDEX} in 0) cd "$PROJECT_PATH" && make build_docker_test_image && make test_cover_ci;; 1) cd "$PROJECT_PATH" && make build_docker_test_image && make test_apps_ci;; 2) cd "$PROJECT_PATH" && make build_docker_test_image && make test_persistence_ci;; 3) cd "$PROJECT_PATH" && make build_docker_test_image && make test_p2p;; esac:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugly but works. build_docker... could be added as pre-run to the relevant make targets but that's gonna get re-worked with jenkins anyway

circle.yml Outdated
#- cd "$PROJECT_PATH" && mv test_integrations.log "${CIRCLE_ARTIFACTS}"
#- cd "$PROJECT_PATH" && bash <(curl -s https://codecov.io/bash) -f coverage.txt
#- cd "$PROJECT_PATH" && mv coverage.txt "${CIRCLE_ARTIFACTS}"
#- cd "$PROJECT_PATH" && cp test/logs/messages "${CIRCLE_ARTIFACTS}/docker_logs.txt"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what/how to do with this with the parallelism

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is ditching the coverage and the logs. We need to keep both ... I don't know how worth it it is to get this stuff done on Circle if we're only going to move to Jenkins ...

bash test/net/setup.sh

# start the testnet
bash test/net/start.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the mintnet stuff is deprecated. nothing useful in this dir


# before starting tendermint, remove the rpc socket
rm $RPC_ADDR
rm -f $RPC_ADDR
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throws a warning on first run

echo "* branch $BRANCH; testing libs"
# checkout every github.com/tendermint dir and run its tests
bash test/test_libs.sh
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all moved into Makefile, to be consumed by Jenkins and users

test/test.sh Outdated
echo "* [$(date +"%T")] building docker image"
bash "$DIR/docker/build.sh"
fi
pwd
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied over from somewhere ... ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove this too

test/test.sh Outdated
fi
#TODO
## copy the coverage results out of docker container
#docker cp run_test:/go/src/github.com/tendermint/tendermint/coverage.txt .
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also to be dealt with in circle.yml - or just do it right in jenkins once

if [[ "$CIRCLECI" == true ]]; then
docker run --name run_test -e CIRCLECI=true -t tester bash test/run_test.sh
else
docker run --name run_test -t tester bash test/run_test.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved and split to Makefile

if [[ "$SKIP_BUILD" == "" ]]; then
echo
echo "* [$(date +"%T")] building docker image"
bash "$DIR/docker/build.sh"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in makefile

@zramsay zramsay changed the title WIP: run tests in parallel run tests in parallel Dec 29, 2017
@zramsay zramsay changed the title run tests in parallel de-mystify tests & run them in parallel Dec 29, 2017
vagrant ssh -c 'make test_integrations'

### go tests without docker
test_unit:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test would imply all the tests

Makefile Outdated
### coverage, app, persistence, and libs tests
test_cover:
# cleanup
bash ./test/test.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets rename to ./test/cleanup.sh

@zramsay zramsay force-pushed the tests-in-parallel branch 2 times, most recently from 07c218d to 46272a0 Compare January 3, 2018 19:16
@zramsay zramsay force-pushed the tests-in-parallel branch from f299b78 to 086ee4f Compare January 4, 2018 03:19
@zramsay zramsay closed this Jan 4, 2018
@zramsay zramsay reopened this Jan 4, 2018
@zramsay zramsay closed this Jan 4, 2018
@zramsay zramsay reopened this Jan 4, 2018
@zramsay zramsay closed this Jan 4, 2018
@zramsay zramsay reopened this Jan 4, 2018
@zramsay zramsay force-pushed the tests-in-parallel branch from 3ba54fe to 3c78d75 Compare January 8, 2018 17:20
@zramsay zramsay changed the base branch from develop to jenkins January 8, 2018 21:51
@zramsay zramsay merged commit ef94221 into jenkins Jan 8, 2018
@zramsay
Copy link
Contributor Author

zramsay commented Jan 8, 2018

merging to jenkins branch

@zramsay zramsay deleted the tests-in-parallel branch January 8, 2018 21:52
zramsay added a commit that referenced this pull request Jan 30, 2018
xla pushed a commit that referenced this pull request Mar 6, 2018
xla pushed a commit that referenced this pull request Mar 6, 2018
melekes pushed a commit that referenced this pull request Mar 8, 2018
* de-mystify tests & run them in parallel (#1031)

* test optimization for jenkins (#1093)

* makefile cleanup

* tests: split fast and slow go tests, closes #1055

* pr comments

* restore circle conditions

* fix need_abci

* ...

* docker run: no :Z for circle?

* Remove cmd breaking comment
firelizzard18 pushed a commit to AccumulateNetwork/tendermint that referenced this pull request Nov 24, 2023
* unclog build

* Bump version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants