From ccb5ae3d63eca665ee6c2678a5510e96a87b2aca Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Fri, 22 Nov 2024 15:59:47 +0100 Subject: [PATCH 1/6] Trigger on my own fork --- .github/workflows/integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 56ee842a2c..1e97a7c586 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,5 +1,6 @@ name: Run integration tests on: + push: merge_group: pull_request: branches: From 494d6ecd01f3166f40221beb4171ed6e346804e4 Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Sun, 24 Nov 2024 14:39:13 +0100 Subject: [PATCH 2/6] Use advice of random SO persons https://stackoverflow.com/a/53092148 --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1e97a7c586..440360bc1c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -76,7 +76,7 @@ jobs: done - name: dump the db if: ${{ !cancelled() }} - run: mysqldump -uroot -proot domjudge > /tmp/db.sql + run: mysqldump -uroot -proot --quick --max_allowed_packet=512M domjudge > /tmp/db.sql - name: Upload database dump for debugging if: ${{ !cancelled() }} uses: actions/upload-artifact@v3 From b98b1d9743acda362f487ccf268995f02537e45a Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Sun, 24 Nov 2024 15:24:09 +0100 Subject: [PATCH 3/6] Use latest version of the action --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 440360bc1c..8b083e9c13 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -79,7 +79,7 @@ jobs: run: mysqldump -uroot -proot --quick --max_allowed_packet=512M domjudge > /tmp/db.sql - name: Upload database dump for debugging if: ${{ !cancelled() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: DB-dump path: /tmp/db.sql From 32b8f12bf022a0512de4617eefad21f2e9ad1ad3 Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Fri, 22 Nov 2024 12:33:18 +0100 Subject: [PATCH 4/6] Test with different SQL isolation levels To detect potential race conditions it's good to try to restructure the queries to fit in a higher level. Some companies/universities might run with this setting. --- .github/workflows/integration.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8b083e9c13..9505b6d3b3 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -11,6 +11,9 @@ jobs: integration: runs-on: ubuntu-24.04 timeout-minutes: 20 + strategy: + matrix: + SQL_ISOLATION: ['REPEATABLE-READ', 'SERIALIZABLE'] container: image: domjudge/gitlabci:24.04 options: --privileged --cgroupns=host --init @@ -39,6 +42,8 @@ jobs: run: pstree -p - name: Install DOMjudge run: .github/jobs/baseinstall.sh all + - name: Set SQL isolation + run: echo "SET GLOBAL transaction_isolation=${{ matrix.SQL_ISOLATION }};" mysql -uroot -proot -hsqlserver - name: Set up chroot run: sudo misc-tools/dj_make_chroot -a amd64 - name: Check nginx @@ -81,13 +86,13 @@ jobs: if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: DB-dump + name: DB-dump-${{ matrix.SQL_ISOLATION }} path: /tmp/db.sql - name: Upload all logs/artifacts if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: Logs + name: Logs-${{ matrix.SQL_ISOLATION }} path: | /var/log/nginx /opt/domjudge/domserver/webapp/var/log/*.log From 2899dcb89983e0107b5de18e94997b879a678d5a Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Fri, 22 Nov 2024 10:09:32 +0100 Subject: [PATCH 5/6] Bring back testing with MySQL The original reason was after the `rank` becoming a protected keyword. As we depend on doctrine as abrstraction a lot it is good to verify that the translation is reasonable on backend SQL servers of whatever dialect. --- .github/workflows/integration.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9505b6d3b3..e2788bb299 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -14,19 +14,24 @@ jobs: strategy: matrix: SQL_ISOLATION: ['REPEATABLE-READ', 'SERIALIZABLE'] + include: + - sql: mariadb + sql_options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 + - sql: mysql + sql_options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 container: image: domjudge/gitlabci:24.04 options: --privileged --cgroupns=host --init services: sqlserver: - image: mariadb + image: ${{ matrix.sql }} + options: ${{ matrix.sql_options }} ports: - 3306:3306 env: MYSQL_ROOT_PASSWORD: root MYSQL_USER: domjudge MYSQL_PASSWORD: domjudge - options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - uses: actions/checkout@v4 - name: info @@ -86,13 +91,13 @@ jobs: if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: DB-dump-${{ matrix.SQL_ISOLATION }} + name: DB-dump-${{ matrix.SQL_ISOLATION }}-${{ matrix.sql }} path: /tmp/db.sql - name: Upload all logs/artifacts if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: Logs-${{ matrix.SQL_ISOLATION }} + name: Logs-${{ matrix.SQL_ISOLATION }}-${{ matrix.sql }} path: | /var/log/nginx /opt/domjudge/domserver/webapp/var/log/*.log From 58e2a6e5b7a1bc14cf805130f10787ea3311d987 Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Sun, 24 Nov 2024 16:17:42 +0100 Subject: [PATCH 6/6] Get 3 jobs --- .github/workflows/integration.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e2788bb299..70d1535980 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -14,18 +14,20 @@ jobs: strategy: matrix: SQL_ISOLATION: ['REPEATABLE-READ', 'SERIALIZABLE'] + SQL: [mariadb, mysql] include: - - sql: mariadb - sql_options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 - - sql: mysql - sql_options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + - SQL: mysql + SQL_options: --health-cmd="mysqladmin ping" + - SQL: mariadb + SQL_options: --health-cmd="healthcheck.sh --connect --innodb_initialized" + SQL_ISOLATION: 'REPEATABLE-READ' container: image: domjudge/gitlabci:24.04 options: --privileged --cgroupns=host --init services: sqlserver: - image: ${{ matrix.sql }} - options: ${{ matrix.sql_options }} + image: ${{ matrix.SQL }} + options: ${{ matrix.SQL_options }} --health-interval=10s --health-timeout=5s --health-retries=3 ports: - 3306:3306 env: @@ -91,13 +93,13 @@ jobs: if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: DB-dump-${{ matrix.SQL_ISOLATION }}-${{ matrix.sql }} + name: DB-dump-${{ matrix.SQL_ISOLATION }}-${{ matrix.SQL }} path: /tmp/db.sql - name: Upload all logs/artifacts if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: Logs-${{ matrix.SQL_ISOLATION }}-${{ matrix.sql }} + name: Logs-${{ matrix.SQL_ISOLATION }}-${{ matrix.SQL }} path: | /var/log/nginx /opt/domjudge/domserver/webapp/var/log/*.log