Reproduce the GitHub Actions functional test environment on your machine.
These services must be running on localhost (you probably already have them):
- MongoDB
- PostgreSQL (postgis)
- Mosquitto
- Context Server (port 7080)
From the repo root:
# Run a specific test
./test/ga-functest.sh test/functionalTest/cases/0000_ngsild/ws_patch_entity.test
# Run all tests
./test/ga-functest.sh
# Run a GA shard range
./test/ga-functest.sh --fromIx 0 --toIx 700
# Cleanup
./test/ga-functest.sh --cleanupFor debugging failures — gives you a shell inside the container.
docker build -f docker/Dockerfile-test -t orion-ld-test:local .docker run --name ga-functest --network host \
-v ~/git/orionld-1:/opt/orion \
-e CB_FT_VERBOSE=ON \
-e ORIONLD_CORE_CONTEXT_DIR=/opt/orion/ldcontexts \
--entrypoint /bin/bash \
-it orion-ld-test:localgit config --global --add safe.directory /opt/orion
rm -rf BUILD_RELEASE/CMakeCache.txt BUILD_RELEASE/CMakeFiles
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
cd /opt/orion
make install
. scripts/testEnv.sh
CB_DIFF_TOOL="diff -u" test/functionalTest/testHarness.sh ws_patch_entity.testYou stay inside the container. Check logs, re-run tests, start the broker manually:
orionld -fg # foreground, see startup errorsdocker start ga-functest
docker exec -it ga-functest bash- CMakeCache.txt: Host paths (
/home/kz/...) don't match container paths (/opt/orion). DeleteBUILD_RELEASE/CMakeCache.txtandBUILD_RELEASE/CMakeFileson first build inside the container. - git safe.directory: The volume mount changes ownership. Run
git config --global --add safe.directory /opt/orion. - PKG_CONFIG_PATH: Not set by default in interactive mode. Export it before
make install.