diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f9e99e7..8139727 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,22 +50,6 @@ build-json-api: expire_in: 30 mins -build-keys: - stage: build - only: - refs: - - master - - # Here we generate some hmac keys for testing before we go on to testing - script: - - head --bytes=32 /dev/urandom > hmac.secret - - head --bytes=32 /dev/urandom > wss-hmac.secret - - artifacts: - paths: - - hmac.secret - - wss-hmac.secret - build-rtc-server: stage: build @@ -136,7 +120,6 @@ build-wiki: # Test routines past this point cargo-test-json-api: - # Basic cargo unit tests(that honestly are nearly useless) stage: test needs: - build-json-api @@ -152,9 +135,12 @@ cargo-test-json-api: HMAC_PATH: "../hmac.secret" WSS_HMAC_PATH: "../wss-hmac.secret" + script: + - head --bytes=32 /dev/urandom > hmac.secret + - head --bytes=32 /dev/urandom > wss-hmac.secret - cd json-api/ - - cargo test --release + - cargo test --release -- --nocapture artifacts: paths: @@ -167,7 +153,6 @@ full-mock-tests: needs: - build-json-api - build-rtc-server - - build-keys only: refs: @@ -175,13 +160,35 @@ full-mock-tests: dependencies: - build-json-api - build-rtc-server - - build-keys + + # Note: the command line flags below are probably redundant/pointless but + # this is here in case something becomes fuxy with them as both implementations + # are(at the time of writing this) in a more/less _improve later_ state + before_script: + - export HMAC_PATH="../hmac.secret" + - export WSS_HMAC_PATH="../wss-hmac.secret" script: - - cd json-api/client-tests/ - - virtualenv . - - source bin/activate && pip install -r requirements.txt - - cd ../../ + # Setup some dummy keys + - head --bytes=32 > hmac.secret + - head --bytes=32 > wss-hmac.secret + # Install deps for the client + - pushd json-api/client-tests/ + - virtualenv . && source bin/activate && pip install -r requirements.txt + - popd + # Next we setup the databases tables - bash scripts/build-db.sh json-api/migrations/ json-api/.env - - bash scripts/run-api-tests.sh + # It's typically safer to turn on the rtc-server first all it does is provide + # data for listeners, the api-server is the one that talks to this server mostly + # See https://freechat.shockrah.xyz/#rtc-auth for the intra-network architecture + - pushd rtc-server/ + - npm run autotest& + - popd + - pushd json-api/ + - cargo run --release -- -H ../hmac.secret -w ../wss-hmac.secret -s& + - popd + # Sleep just in case cargo takes 999 years to startup in gitlab's pipeline + - sleep 5 + # TODO: do some kind of more intelligent logging here (maybe some integrations or something idk) + - pushd json-api/client-tests && source bin/activate && python main.py