Initial continuous integration with Travis CI #77
Conversation
expect /opt/ci/test-neo-cli.expect | ||
|
||
# Start neo-cli in background for additional JSON-RPC tests | ||
screen -dmS node1 bash -c "dotnet neo-cli.dll --rpc" |
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 should make sure this screen is closed after tests have run
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.
The Docker container is killed after the tests, so it wouldn't matter. Edit: For reusability and flexibility it could still be good to kill it though.
Edit2: I'll think about this a bit more. This would make things more complex because the grep commands for the JSON-API response will exit the script with an error exit code at that point. So we would need to wrap the JSON-RPC tests in another script, check the exit codes, kill the screen session, and then exit with the exit code of the JSON-RPC tests. Not sure about the benefit and if this is worth the added complexity.
ci/README.md
Outdated
@@ -0,0 +1,14 @@ | |||
This are files for the continuous integration with Travis CI. |
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.
'This' should be 'These'
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.
fixed
I like these changes, they will add more robustness to this repo. Given the amount of functionality exposed through
|
I have set it up. So how do I test it? |
To run it locally, you'll need to have Docker CE installed. Then just run
If you want to set it up with this GitHub repository, enable this repository at Travis CI (see this guide), and merge this PR. On all code pushes (including the merge commit), the build at Travis is triggered. This is how an example output at Travis looks like. |
So, anyone has tested it locally? |
Works! You can see the output of the builds here: https://travis-ci.org/neo-project/neo-cli If you want to add a travis-ci build status badge for the master branch like this: , you can use this code for the readme (markdown format):
|
Proposal of an initial continuous integration setup using Travis CI (see also #72).
If merged and enabled at Travis CI, code pushes to GitHub will automatically build the code and run a number of tests to verify the neo-cli functionality.
.travis.yml
expect
change, thetest-neo-cli.expect
script will also need to be updated accordingly.dotnet neo-cli.dll --rpc
, and the JSON-RPC api is tested withcurl
commands. Currently one json-rpc test is implemented: queryingtotalSupply
of the RPX token. This can catch errors such as Error 400 Access Denied on neo-cli 2.5.2 #71.Example output of Travis CI: https://travis-ci.org/metachris/neo-cli/builds/322348356
This PR is an initial CI setup which can easily be extended with more tests in the future.
Looking forward to hearing your thoughts, and whether you are interested in all of those tests or just a part of it, or something completely different. I'd also like to know how you want to name the directory which contains the continuous integration scripts (in this proposal it's simply
/ci
).