Skip to content

Commit 2db63a5

Browse files
committed
setup github workflow to run gui tests for branded client
Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
1 parent 9638dde commit 2db63a5

3 files changed

Lines changed: 114 additions & 2 deletions

File tree

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

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)