-
Notifications
You must be signed in to change notification settings - Fork 8
6 automated tests #7
6 automated tests #7
Conversation
Create a JUnit4 Testsuite for integration tests that sets up a Testenvironment - starting Alda servers - before running the integration tests. When the suite finishes it cleans up the Testenvironment by shutting down the running Alda servers. Servers getting started and stopped from the TestEnvironment class by calling the alda exexutable unter test/resources/client/. If tests rely on the output/behavior of a specific server version this executable has to be changed/updated accordingly. see: #6
Test that the ouput of AldaClient listProcesses method - called by the 'alda list' command - lists all started servers with the correct port and the workers on the corresponding backend port. see: #4 'alda list' output buggy when mutliple servers are running
Test that AldaClient checkForExistingServer method detects running server on host and port.
Thanks for the PR! This is looking great so far. I have a few comments:
|
AldaClientTest listProccessesOuput fails when run from the terminal via 'boot test'. The port string parsed from the output stream contains ansi escapes. Cleaning the string from the ansi escapes fixes this issue.
Hi, hard-coded port boot test error running test server through main method |
I really like how this is coming along! I see what you're saying about the release executable. Instead of including the executable in the git repo and hard-coding in the path, what if we had the test suite check for an for version in $(ls /var/alda/releases); do
ALDA_EXECUTABLE=/var/alda/releases/$version boot test
done This would also require no configuration at all for developers who already have a release of Alda installed to |
Agreed, My main point here is to keep the setup simple. There are projects out there where you find the bug in minutes but spent hours to set up the environment. This project is actual in a state where you simply
all done with only git a jdk and no configuration. |
That's an excellent point -- I agree, it would be good to make sure this project remains approachable for Java developers who may not be used to Boot. |
Check for the alda executable in the following order: 1. ALDA_EXECUTABLE environment variable If this variable is set treat the value as the path to the alda executable. 2. /usr/local/bin/alda Check if this installation exists and use the executable. 3. test/resources/server/alda Fallback to the test/resources/server directory. Include this directory in the gitignore file. Therefore a alda executable put in there will not be tracked/submited by git.
Ok - added one more commit.
|
This looks great! I think we're good to merge. Thanks a lot for all your work on this 🍻 |
Hi,
the Pull Request contains a JUnit4 Testsuite which boots up AldaServers before running tests and cleans up the servers afterwards.
Also two tests for the AldaClient class. One checks the output of the listProcesses method - called by 'alda list' - and therefore completes the fix for #4. The other tests the checkForExistingServer method. Details in the commit messages.
I was about to write a test for the findExistingSocketForHostAndPort method - also in the fix for #4 - but the codebase could use some refactoring to increase testability.
If JUnit4 is ok i would give it a try and start some refactoring for further tests.
regards tobias