From 6e66c119a166763fcf163ce637ce6a850af10a99 Mon Sep 17 00:00:00 2001 From: Matus Kasak Date: Wed, 9 Jul 2025 13:38:49 +0200 Subject: [PATCH 1/3] Created trigger for running UI tests for each customer daily --- .github/workflows/automated-manual-tests.yml | 39 ++++++++++++++++++++ .github/workflows/trigger-ui-tests.yml | 30 +++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/automated-manual-tests.yml create mode 100644 .github/workflows/trigger-ui-tests.yml diff --git a/.github/workflows/automated-manual-tests.yml b/.github/workflows/automated-manual-tests.yml new file mode 100644 index 00000000000..a7ec4197627 --- /dev/null +++ b/.github/workflows/automated-manual-tests.yml @@ -0,0 +1,39 @@ +name: Automated manual tests + +on: + workflow_dispatch: + workflow_call: + +jobs: + playwright-tests: + runs-on: dspace-test-1 + timeout-minutes: 45 + steps: + - name: Checkout Playwright tests + uses: actions/checkout@v4 + with: + repository: dataquest-dev/dspace-ui-tests + path: dspace-ui-tests + token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }} + + - name: Checkout main repository + uses: actions/checkout@v4 + with: + path: this-repository + + - name: Copy customer config to UI tests repository for merging + run: | + cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/ + + - name: test + working-directory: dspace-ui-tests/scripts + env: + HOME_URL: https://dev-5.pc:8443/repository/ + NAME: LINDAT + run: | + ./test.sh + + - uses: mazoea/ga-maz/end@master + with: + CHOWN_DIR: ./ + if: ${{ always() }} \ No newline at end of file diff --git a/.github/workflows/trigger-ui-tests.yml b/.github/workflows/trigger-ui-tests.yml new file mode 100644 index 00000000000..6bb48abdb5f --- /dev/null +++ b/.github/workflows/trigger-ui-tests.yml @@ -0,0 +1,30 @@ +name: Trigger UI Tests for All Customer Branches + +on: + workflow_dispatch: + workflow_call: + schedule: + - cron: '0 5 * * *' + +permissions: + actions: write # Grants permission to trigger workflows + contents: read # Access to repository contents + +jobs: + trigger-builds: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get and Trigger Customer Branch UI Tests + run: | + # Authenticate with GitHub CLI using the token + echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token + + git fetch --prune origin + BRANCHES=$(git ls-remote --heads origin | awk -F'/' '{print $3"/"$4}' | grep '^customer/') + for branch in $(echo "$BRANCHES" | sed -e 's/[\[\]"]//g' -e 's/,/\n/g'); do + echo "Triggering UI tests for branch: $branch" + gh workflow run automated-manual-tests.yml --ref $branch + done \ No newline at end of file From b25b9383bed3e80063400b12dd58f1462cd0578c Mon Sep 17 00:00:00 2001 From: Matus Kasak Date: Wed, 9 Jul 2025 16:41:21 +0200 Subject: [PATCH 2/3] Corrected spaces --- .github/workflows/automated-manual-tests.yml | 54 ++++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/automated-manual-tests.yml b/.github/workflows/automated-manual-tests.yml index a7ec4197627..97b885a8870 100644 --- a/.github/workflows/automated-manual-tests.yml +++ b/.github/workflows/automated-manual-tests.yml @@ -6,34 +6,34 @@ on: jobs: playwright-tests: - runs-on: dspace-test-1 - timeout-minutes: 45 - steps: - - name: Checkout Playwright tests - uses: actions/checkout@v4 - with: - repository: dataquest-dev/dspace-ui-tests - path: dspace-ui-tests - token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }} + runs-on: dspace-test-1 + timeout-minutes: 45 + steps: + - name: Checkout Playwright tests + uses: actions/checkout@v4 + with: + repository: dataquest-dev/dspace-ui-tests + path: dspace-ui-tests + token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }} - - name: Checkout main repository - uses: actions/checkout@v4 - with: - path: this-repository + - name: Checkout main repository + uses: actions/checkout@v4 + with: + path: this-repository - - name: Copy customer config to UI tests repository for merging - run: | - cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/ + - name: Copy customer config to UI tests repository for merging + run: | + cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/ - - name: test - working-directory: dspace-ui-tests/scripts - env: - HOME_URL: https://dev-5.pc:8443/repository/ - NAME: LINDAT - run: | - ./test.sh + - name: test + working-directory: dspace-ui-tests/scripts + env: + HOME_URL: https://dev-5.pc:8443/repository/ + NAME: LINDAT + run: | + ./test.sh - - uses: mazoea/ga-maz/end@master - with: - CHOWN_DIR: ./ - if: ${{ always() }} \ No newline at end of file + - uses: mazoea/ga-maz/end@master + with: + CHOWN_DIR: ./ + if: ${{ always() }} \ No newline at end of file From b2b1df06f72e0c4c9e2718312a767a995f95fd30 Mon Sep 17 00:00:00 2001 From: Matus Kasak Date: Thu, 10 Jul 2025 09:28:50 +0200 Subject: [PATCH 3/3] Changed name of the tests --- .../{automated-manual-tests.yml => playwright-tests.yml} | 2 +- .github/workflows/trigger-ui-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{automated-manual-tests.yml => playwright-tests.yml} (97%) diff --git a/.github/workflows/automated-manual-tests.yml b/.github/workflows/playwright-tests.yml similarity index 97% rename from .github/workflows/automated-manual-tests.yml rename to .github/workflows/playwright-tests.yml index 97b885a8870..4cfe6f64e45 100644 --- a/.github/workflows/automated-manual-tests.yml +++ b/.github/workflows/playwright-tests.yml @@ -1,4 +1,4 @@ -name: Automated manual tests +name: Playwright tests on: workflow_dispatch: diff --git a/.github/workflows/trigger-ui-tests.yml b/.github/workflows/trigger-ui-tests.yml index 6bb48abdb5f..22dfc03fdf6 100644 --- a/.github/workflows/trigger-ui-tests.yml +++ b/.github/workflows/trigger-ui-tests.yml @@ -26,5 +26,5 @@ jobs: BRANCHES=$(git ls-remote --heads origin | awk -F'/' '{print $3"/"$4}' | grep '^customer/') for branch in $(echo "$BRANCHES" | sed -e 's/[\[\]"]//g' -e 's/,/\n/g'); do echo "Triggering UI tests for branch: $branch" - gh workflow run automated-manual-tests.yml --ref $branch + gh workflow run playwright-tests.yml --ref $branch done \ No newline at end of file