From f952b91a32b46437d9b31d76844ee15a2fe2629e Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 12 May 2021 16:04:58 -0700 Subject: [PATCH] - Removing broken build job build-json-api Issue seemed to be that artifacts were not being preserved properly. This was causing failures in test stages where it was basicallly impossible to debug "real" issues - Removing artifacting (json-api) for now They'll be re-added when there's a good way of verifying the quality of builds. For now they're gone because the mock test stage is doing a lot of work already + mock-test job now builds json-api This fixes the first issue this patches intends on fixing however it's kinda cheesy and should probably be replaced at some point with a better fix --- .gitlab-ci.yml | 49 ++++++------------------------------------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb6f90a..b4470d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,31 +26,6 @@ before_script: - export PATH="$CARGO_HOME/bin:$PATH" -build-json-api: - # This is easily the most expensive stage since cargo sucks so we try to cache - # everything we can between jobs here - stage: build - - only: - refs: - - master - - script: - - cd json-api/ - - cargo build --release - - - # primarily used to cache between jobs - # expirey time overwritten later for weekly builds - artifacts: - paths: - - json-api/target/ - - $CARGO_HOME - - expire_in: 30 mins - - - build-rtc-server: stage: build only: @@ -121,16 +96,10 @@ build-wiki: # Test routines past this point cargo-test-json-api: stage: test - needs: - - build-json-api only: refs: - master - - dependencies: - - build-json-api - variables: HMAC_PATH: "../hmac.secret" WSS_HMAC_PATH: "../wss-hmac.secret" @@ -142,23 +111,15 @@ cargo-test-json-api: - cd json-api/ - cargo test --release -- --nocapture - artifacts: - paths: - - json-api/target/release/json-api - expire_in: 1 week - name: json-api - full-mock-tests: stage: test needs: - - build-json-api - build-rtc-server only: refs: - master dependencies: - - build-json-api - build-rtc-server # Note: the command line flags below are probably redundant/pointless but @@ -167,8 +128,13 @@ full-mock-tests: before_script: - export HMAC_PATH="../hmac.secret" - export WSS_HMAC_PATH="../wss-hmac.secret" + - export DATABASE_URL="mysql://freechat_dev:password@localhost:3306/freechat" script: + # Building here because cargo caching has ruined 2 many pipelines :( + - pushd json-api/ + - cargo build --release + - popd # Setup some dummy keys - head --bytes=32 > hmac.secret - head --bytes=32 > wss-hmac.secret @@ -181,15 +147,12 @@ full-mock-tests: # 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/ # Yes i know this looks kinda wack but hopefully cargo won't try to reuild if just - # use the binary directly - cargo run --release -- -H ../hmac.secret -w ../wss-hmac.secret -s& - popd - 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 + - pushd json-api/ && source client-tests/bin/activate && python client-tests/main.py