Skip to content

Commit 98a525a

Browse files
committed
setup github workflow to run gui tests for branded client
Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
1 parent 75a2176 commit 98a525a

4 files changed

Lines changed: 119 additions & 6 deletions

File tree

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: GUI Tests (Branded Client)
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "0 0 * * *"
8+
9+
env:
10+
NPM_GHERLINT: "@gherlint/gherlint@1.1.0"
11+
S3_PUBLIC_CACHE_SERVER: "https://cache.owncloud.com"
12+
S3_PUBLIC_CACHE_BUCKET: "public"
13+
14+
jobs:
15+
gui-tests:
16+
runs-on: ubuntu-latest
17+
container: owncloudci/squish:fedora-42-8.1.0-qt68x-linux64
18+
env:
19+
PLAYWRIGHT_BROWSERS_PATH: /__w/client/client/test/gui/.playwright
20+
GITHUB_REPO: ${{ github.repository }}
21+
GITHUB_RUN_NUMBER: ${{ github.run_number }}
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v6
25+
26+
- name: Build client
27+
run: |
28+
mkdir -p build
29+
cd build
30+
cmake -G"Ninja" \
31+
-DWITH_EXTERNAL_BRANDING=https://x-access-token:${{ secrets.KW_THEME_PAT }}@github.com/owncloud/client-desktop-theme-kiteworks.git \
32+
-DCMAKE_BUILD_TYPE=Debug \
33+
-DBUILD_TESTING=OFF \
34+
-S ..
35+
ninja
36+
37+
- name: Install Python Modules
38+
run: |
39+
export PATH=$PATH:/github/home/.local/bin
40+
make -C test/gui install
41+
python3.10 -m pip list -v
42+
43+
- name: Create GUI test report directory
44+
run: |
45+
mkdir test/gui/guiReportUpload/screenshots -p
46+
chmod 777 test/gui -R
47+
48+
- name: Map predefined users
49+
run: echo "${{ secrets.PREDEFINED_USERS }}" | base64 -d > test/gui/users.json
50+
51+
- name: Run GUI tests
52+
id: run_gui_test
53+
env:
54+
LICENSEKEY: ${{ secrets.SQUISH_LICENSEKEY }}
55+
GUI_TEST_REPORT_DIR: /__w/client/client/test/gui/guiReportUpload
56+
CLIENT_REPO: .
57+
CLIENT_NAME: ${{ secrets.CLIENT_NAME }}
58+
PERSONAL_SYNC_FOLDER: ${{ secrets.PERSONAL_SYNC_FOLDER }}
59+
PREDEFINED_USERS: users.json
60+
OCIS_URL: ${{secrets.BACKEND_HOST}}
61+
BACKEND_HOST: ${{secrets.BACKEND_HOST}}
62+
SECURE_BACKEND_HOST: ${{secrets.BACKEND_HOST}}
63+
OCIS: true
64+
SERVER_INI: test/gui/ci/client_server.ini
65+
SQUISH_PARAMETERS: >
66+
--testsuite test/gui
67+
--reportgen html,test/gui/guiReportUpload
68+
--envvar QT_LOGGING_RULES=sync.httplogger=true;gui.socketapi=false
69+
--tags ~@skip --tags ~@skipOnLinux --tags @predefined_users
70+
--abortOnFail
71+
STACKTRACE_FILE: test/gui/guiReportUpload/stacktrace.log
72+
OWNCLOUD_CORE_DUMP: 1
73+
RECORD_VIDEO_ON_FAILURE: false
74+
COREPACK_ENABLE_STRICT: 0
75+
HOME: /home/headless
76+
run: bash /dockerstartup/entrypoint.sh
77+
78+
- name: Upload GUI test result
79+
if: ${{ failure() && steps.run_gui_test.outcome == 'failure' }}
80+
run: |
81+
curl -L https://dl.min.io/client/mc/release/linux-amd64/mc -o /tmp/mc
82+
chmod +x /tmp/mc
83+
/tmp/mc alias set cache ${{ env.S3_PUBLIC_CACHE_SERVER }} ${{ secrets.CACHE_PUBLIC_S3_ACCESS_KEY }} ${{ secrets.CACHE_PUBLIC_S3_SECRET_KEY }}
84+
/tmp/mc cp --recursive test/gui/guiReportUpload cache/${{ env.S3_PUBLIC_CACHE_BUCKET }}/${{ github.repository }}/${{ github.run_number }}/ocis
85+
86+
- name: Log GUI reports
87+
if: ${{ failure() && steps.run_gui_test.outcome == 'failure' }}
88+
env:
89+
REPORT_DIR: /__w/client/client/test/gui/guiReportUpload
90+
SERVER_TYPE: ocis
91+
run: bash test/gui/ci/log_reports.sh ${REPORT_DIR} ${GITHUB_REPO} ${GITHUB_RUN_NUMBER} ${SERVER_TYPE}
92+
93+
notification:
94+
needs: gui-tests
95+
if: github.event_name == 'schedule'
96+
runs-on: ubuntu-latest
97+
container:
98+
image: owncloudci/alpine:latest
99+
steps:
100+
- name: Checkout
101+
uses: actions/checkout@v6
102+
103+
- name: notify-matrix
104+
env:
105+
CACHE_ENDPOINT: ${{ env.S3_PUBLIC_CACHE_SERVER }}
106+
CACHE_BUCKET: ${{ env.S3_PUBLIC_CACHE_BUCKET }}
107+
MATRIX_TOKEN: ${{ secrets.MATRIX_TOKEN }}
108+
GITHUB_BUILD_STATUS: ${{ needs.gui-tests.result }}
109+
COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }}
110+
run: bash test/gui/ci/notification_template.sh .

.github/workflows/gui-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: GUI Tests
22

33
on:
4-
pull_request:
5-
push:
6-
branches: [ master ]
7-
tags: [ "*" ]
4+
# pull_request:
5+
# push:
6+
# branches: [ master ]
7+
# tags: [ "*" ]
88
schedule:
99
- cron: "0 0 * * *"
1010

test/gui/ci/client_server.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[General]
2+
AUT/kiteworks = "/__w/client/client/build/bin"
3+
AUTPMTimeout = "15000"

test/gui/tst_syncing/test.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ Feature: Syncing files
376376
| filename |
377377
| thisIsAVeryLongFileNameToCheckThatItWorks-thisIsAVeryLongFileNameToCheckThatItWorks-thisIsAVeryLongFileNameToCheckThatItWorks-thisIsAVeryLongFileNameToCheckThatItWorks-thisIsAVeryLongFileNameToCheckThatItWorks-thisIs.txt |
378378

379-
@predefined_users
379+
380380
Scenario: Syncing file of 1 GB size
381381
Given user "Alice" has set up a client with default settings
382382
When user "Alice" creates a file "newfile.txt" with size "1GB" inside the sync folder
@@ -393,7 +393,7 @@ Feature: Syncing files
393393
And the user waits for file "file with space.txt" to be synced
394394
Then as "Alice" file "file with space.txt" should exist in the server
395395

396-
@predefined_users
396+
397397
Scenario: Syncing folders each having 500 files
398398
Given the user has created a folder "folder1" in temp folder
399399
And the user has created "500" files each of size "1048576" bytes inside folder "folder1" in temp folder

0 commit comments

Comments
 (0)