New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add script to test TiSpark #33
Conversation
.travis.yml
Outdated
@@ -12,3 +12,5 @@ before_install: | |||
script: | |||
- docker ps -a --format="{{.Names}} {{.Image}} {{.Status}}" | grep -v 'Up' | grep -v 'Exited (0)' | awk '{print} END {if (NR>0) {exit 1;}}' | |||
- mysql -h 127.0.0.1 -P 4000 -u root -e "select tidb_version()\G" # test if tidb-server is working | |||
- docker-compose exec tispark-master bash /opt/tispark/tests/loaddata.sh # add some data for tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to load data from host.
- download and extract tispark-sample-data
- load data from host
These two steps can be done inbefore_install
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do that (or why)? those data already extracted in the master image/container.
This call only inject the data into tidb my mysql interface. There is no downloading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can load data from host, we are sure we can access TiDB, so no need to do the select tidb_version()
step. And we don't need to add extra script to tispark-master container. But if you insist your option, I'm OK with it.
docker-compose.yml
Outdated
@@ -123,6 +123,7 @@ services: | |||
- /opt/spark/sbin/start-master.sh | |||
volumes: | |||
- ./config/spark-defaults.conf:/opt/spark/conf/spark-defaults.conf:ro | |||
- ./tispark/tests:/opt/tispark/tests:ro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can start another container connecting to tidb-docker-compose network and run tests there without affecting tispark-master container.
f04adbc
to
2f7c9a6
Compare
docker-compose-test.yml
Outdated
networks: | ||
default: | ||
external: | ||
name: tidbdockercompose_default # when travis'd docker version updates, use: tidb-docker-compose_default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can upgrade travis docker and docker-compose version as needed. https://docs.travis-ci.com/user/docker/#Installing-a-newer-Docker-version
@tennix finally it's working now. I had to update the docker-compose version as well to make it work with the newer way of network name. |
80b0eb0
to
ab0c8e7
Compare
And let me know if you want me to squash everything into a single commit. Otherwise I think you can use the squash and merge option on the merge button. Looks like the tispark issue has been fixed, the build can all go through now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adding another docker-compose file for testing looks good. |
* Add script to test TiSpark * Remove mysql test, use tispark-tests to test tidb connection
To add another test to verify the tispark component can work.
So to have some early warning of errors mentioned here:
#30
Current build job will fail due to issue mentioned at #30
@tennix Do you mind help re-run the test of this PR when the TiSpark docker image get updated?