From 5d0f02507bdb8bd0e688c29c45679364ecbd0b10 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 3 May 2021 13:30:52 -0700 Subject: [PATCH] - Removing build-keys job Was basically pointless since it's literally just two commands ! full-mock-test job now has scripts/run-api-tests.sh as its source code This makes it way easier to debug the pipeline when things go wrong as there's lots of _different_ things going on in that script. While the script itself is still there it is completely deprecated and safe to remove at this point ! PAIN Peko Dependancies might be fucked because gitlab-runner doesn't use deps at all and frankly I'm completely over doing this stupid patch. Next is decentralized features which is way more fun to do so if it breaks I'll fix it but its likely an issue with artifacts --- .gitlab-ci.yml | 57 ++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 25 deletions(-) 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