f45ab312bb
This is just a very minor directory organization change, but it has the advantage of keeping a bunch of files out of the root directory and packaging them together since they are related to each other. Now, our `integration_tests/` directory has a nice pattern of setup/cleanup/test.sh scripts at the top global level and at each module level: ``` ❯ tree --dirsfirst integration_tests integration_tests ├── mysql │ ├── util │ │ ├── launch_mysql_container.sh │ │ └── wait_for_mysqld.sh │ ├── cleanup.sh │ ├── setup.sh │ ├── single_run.sh │ └── test.sh ├── ssh │ ├── cleanup.sh │ ├── setup.sh │ └── test.sh ├── cleanup.sh ├── setup.sh └── test.sh 3 directories, 12 files ``` The scripts are runnable via: ``` ./integration_tests/setup.sh && ./integration_tests/test.sh && ./integration_tests/cleanup.sh ```
26 lines
557 B
Bash
Executable File
26 lines
557 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
# Set up the integration tests for all modules.
|
|
# Drop your setup script(s) in integration_tests/<protocol>/setup(.*).sh
|
|
|
|
# Run from root of project
|
|
TEST_DIR=$(dirname "$0")
|
|
cd "$TEST_DIR/.."
|
|
|
|
echo "Setting up integration tests..."
|
|
|
|
pushd integration_tests
|
|
for mod in $(ls); do
|
|
if [ -d "$mod" ]; then
|
|
pushd $mod
|
|
for setup in $(ls setup*.sh); do
|
|
echo "Setting up $mod (integration_tests/$mod/$setup)..."
|
|
./$setup
|
|
done
|
|
popd
|
|
fi
|
|
done
|
|
popd
|
|
|
|
echo "Integration tests setup finished."
|