Skip to content

Commit f1ddbc8

Browse files
committed
Merge branch 'e2e/feature/RI-5743-Rename-capabilities' of https://github.com/RedisInsight/RedisInsight into e2e/feature/RI-5743-Rename-capabilities
2 parents 8500e0d + 9961cd0 commit f1ddbc8

30 files changed

+1031
-228
lines changed

.circleci/config.yml.backup

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,15 +396,36 @@ jobs:
396396
- attach_workspace:
397397
at: .
398398
- run: sudo apt-get install net-tools
399+
- run: sudo apt-get install xdotool
400+
- run: sudo apt-get install -y desktop-file-utils
401+
- run:
402+
name: Install Google Chrome
403+
command: |
404+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
405+
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
406+
sudo apt-get update
407+
sudo apt-get install -y google-chrome-stable
408+
sudo apt-get install -y \
409+
libnss3 \
410+
libgconf-2-4 \
411+
libxss1 \
412+
libasound2
413+
xdg-settings set default-web-browser google-chrome.desktop
399414
- run:
400415
name: Install WM
401416
command: sudo apt install fluxbox
402417
- run:
403-
name: Run X11
418+
name: Install Xvfb
419+
command: sudo apt-get install -y xvfb
420+
- run:
421+
name: Start Xvfb
404422
command: |
405-
Xvfb :99 -screen 0 1920x1080x24 &
423+
if [ -f /tmp/.X99-lock ]; then rm /tmp/.X99-lock; fi
424+
Xvfb :99 -ac -screen 0 1920x1080x24 &
406425
sleep 3
407426
fluxbox &
427+
export DISPLAY=:99
428+
echo $DISPLAY
408429
# - run:
409430
# name: Clone mocked RDI server
410431
# command: |

.circleci/e2e/test.app-image.sh

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,52 @@ set -e
33

44
yarn --cwd tests/e2e install
55

6-
# mount app resources
7-
./release/*.AppImage --appimage-mount >> apppath &
6+
# Create the ri-test directory if it doesn't exist
7+
mkdir -p ri-test
8+
9+
# Extract the AppImage
10+
chmod +x ./release/*.AppImage
11+
./release/*.AppImage --appimage-extract
12+
13+
# Move contents of squashfs-root to ri-test and remove squashfs-root folder
14+
mv squashfs-root/* ri-test/
15+
rm -rf squashfs-root
16+
17+
# Export custom XDG_DATA_DIRS with ri-test
18+
export XDG_DATA_DIRS="$(pwd)/ri-test:$XDG_DATA_DIRS"
819

920
# create folder before tests run to prevent permissions issue
1021
mkdir -p tests/e2e/remote
1122
mkdir -p tests/e2e/rdi
1223

13-
# run rte
24+
# Create a custom .desktop file for RedisInsight
25+
cat > ri-test/redisinsight.desktop <<EOL
26+
[Desktop Entry]
27+
Version=1.0
28+
Name=RedisInsight
29+
Exec=$(pwd)/ri-test/redisinsight %u
30+
Icon=$(pwd)/ri-test/resources/app.asar/img/icon.png
31+
Type=Application
32+
Terminal=false
33+
MimeType=x-scheme-handler/redisinsight;
34+
EOL
35+
36+
# Copy the .desktop file to the local applications directory
37+
cp ri-test/redisinsight.desktop "$HOME/.local/share/applications"
38+
39+
# Update the desktop database with custom directory
40+
update-desktop-database "$(pwd)/ri-test/"
41+
42+
# Register the RedisInsight deeplink protocol
43+
xdg-mime default redisinsight.desktop x-scheme-handler/redisinsight
44+
45+
# Run rte
1446
docker-compose -f tests/e2e/rte.docker-compose.yml build
1547
docker-compose -f tests/e2e/rte.docker-compose.yml up --force-recreate -d -V
1648
./tests/e2e/wait-for-redis.sh localhost 12000 && \
1749

18-
# run tests
19-
COMMON_URL=$(tail -n 1 apppath)/resources/app.asar/dist/renderer/index.html \
20-
ELECTRON_PATH=$(tail -n 1 apppath)/redisinsight \
50+
# Run tests
51+
COMMON_URL=$(pwd)/ri-test/resources/app.asar/dist/renderer/index.html \
52+
ELECTRON_PATH=$(pwd)/ri-test/redisinsight \
2153
RI_SOCKETS_CORS=true \
2254
yarn --cwd tests/e2e dotenv -e .desktop.env yarn --cwd tests/e2e test:desktop:ci

.github/e2e/test.app-image.sh

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,52 @@ set -e
33

44
yarn --cwd tests/e2e install
55

6-
# mount app resources
6+
# Create the ri-test directory if it doesn't exist
7+
mkdir -p ri-test
8+
9+
# Extract the AppImage
710
chmod +x ./release/*.AppImage
8-
./release/*.AppImage --appimage-mount >> apppath &
11+
./release/*.AppImage --appimage-extract
12+
13+
# Move contents of squashfs-root to ri-test and remove squashfs-root folder
14+
mv squashfs-root/* ri-test/
15+
rm -rf squashfs-root
16+
17+
# Export custom XDG_DATA_DIRS with ri-test
18+
export XDG_DATA_DIRS="$(pwd)/ri-test:$XDG_DATA_DIRS"
919

1020
# create folder before tests run to prevent permissions issue
1121
mkdir -p tests/e2e/remote
1222
mkdir -p tests/e2e/rdi
1323

14-
# run rte
15-
docker compose -f tests/e2e/rte.docker-compose.yml build
16-
docker compose -f tests/e2e/rte.docker-compose.yml up --force-recreate -d -V
24+
# Create a custom .desktop file for RedisInsight
25+
cat > ri-test/redisinsight.desktop <<EOL
26+
[Desktop Entry]
27+
Version=1.0
28+
Name=RedisInsight
29+
Exec=$(pwd)/ri-test/redisinsight %u
30+
Icon=$(pwd)/ri-test/resources/app.asar/img/icon.png
31+
Type=Application
32+
Terminal=false
33+
MimeType=x-scheme-handler/redisinsight;
34+
EOL
35+
36+
# Copy the .desktop file to the local applications directory
37+
cp ri-test/redisinsight.desktop "$HOME/.local/share/applications"
38+
39+
# Update the desktop database with custom directory
40+
update-desktop-database "$(pwd)/ri-test/"
41+
42+
# Register the RedisInsight deeplink protocol
43+
xdg-mime default redisinsight.desktop x-scheme-handler/redisinsight
44+
45+
# Run rte
46+
docker-compose -f tests/e2e/rte.docker-compose.yml build
47+
docker-compose -f tests/e2e/rte.docker-compose.yml up --force-recreate -d -V
1748
./tests/e2e/wait-for-redis.sh localhost 12000 && \
1849

19-
# run tests
20-
COMMON_URL=$(tail -n 1 apppath)/resources/app.asar/dist/renderer/index.html \
21-
ELECTRON_PATH=$(tail -n 1 apppath)/redisinsight \
50+
# Run tests
51+
COMMON_URL=$(pwd)/ri-test/resources/app.asar/dist/renderer/index.html \
52+
ELECTRON_PATH=$(pwd)/ri-test/redisinsight \
2253
RI_SOCKETS_CORS=true \
2354
yarn --cwd tests/e2e dotenv -e .desktop.env yarn --cwd tests/e2e test:desktop:ci

.github/workflows/manual-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ jobs:
106106
runs-on: ubuntu-latest
107107

108108
steps:
109+
- uses: actions/checkout@v4
109110
- name: Remove all artifacts
110111
uses: ./.github/actions/remove-artifacts
111112

.github/workflows/release-prod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
with:
1414
group_tests: 'without_e2e'
1515
short_rte_list: false
16+
pre_release: true
1617

1718
builds-prod:
1819
name: Create all builds for release
@@ -63,5 +64,6 @@ jobs:
6364
runs-on: ubuntu-latest
6465

6566
steps:
67+
- uses: actions/checkout@v4
6668
- name: Remove all artifacts
6769
uses: ./.github/actions/remove-artifacts

.github/workflows/release-stage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
with:
1414
group_tests: 'without_e2e'
1515
short_rte_list: false
16+
pre_release: true
1617

1718
builds:
1819
name: Release stage builds
@@ -49,5 +50,6 @@ jobs:
4950
runs-on: ubuntu-latest
5051

5152
steps:
53+
- uses: actions/checkout@v4
5254
- name: Remove all artifacts
5355
uses: ./.github/actions/remove-artifacts # Remove artifacts from github actions

.github/workflows/tests-e2e-appimage.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,29 @@ jobs:
4949
with:
5050
detached: true
5151

52-
- name: Install WM
52+
- name: Install necessary packages
5353
run: |
5454
sudo apt-get update -y
55-
sudo apt-get install kmod libfuse2 xvfb net-tools fluxbox netcat -y
55+
sudo apt-get install kmod libfuse2 xvfb net-tools xdotool desktop-file-utils fluxbox netcat -y
56+
57+
- name: Install Google Chrome
58+
run: |
59+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
60+
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
61+
sudo apt-get update
62+
sudo apt-get install -y google-chrome-stable libnss3 libgconf-2-4 libxss1 libasound2
63+
xdg-settings set default-web-browser google-chrome.desktop
5664
5765
- name: Download AppImage Artifacts
5866
uses: actions/download-artifact@v4
5967
with:
6068
name: linux-builds
6169
path: ./release
6270

63-
- name: Run X11
71+
- name: Start Xvfb
6472
run: |
65-
Xvfb :99 -screen 0 1920x1080x24 &
73+
if [ -f /tmp/.X99-lock ]; then rm /tmp/.X99-lock; fi
74+
Xvfb :99 -ac -screen 0 1920x1080x24 &
6675
sleep 3
6776
fluxbox &
6877

.github/workflows/tests-e2e-docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ jobs:
132132
if: always()
133133
runs-on: ubuntu-latest
134134
steps:
135+
- uses: actions/checkout@v4
135136
- name: Deploy report
136137
uses: ./.github/actions/deploy-test-reports
137138
with:

.github/workflows/tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ on:
3939
description: Use short rte list
4040
type: boolean
4141
default: true
42+
pre_release:
43+
description: Is pre-release
44+
default: false
45+
type: boolean
4246
debug:
4347
description: Enable SSH Debug
4448
default: false
@@ -141,15 +145,16 @@ jobs:
141145
clean:
142146
uses: ./.github/workflows/clean-deployments.yml
143147
needs: [frontend-tests, backend-tests, integration-tests, e2e-docker-tests, e2e-appimage-tests]
144-
if: always()
148+
if: ${{ !inputs.pre_release && always() }}
145149

146150
# Remove artifacts from github actions
147151
remove-artifacts:
148152
name: Remove artifacts
149153
needs: [clean]
150-
if: always()
154+
if: ${{ !inputs.pre_release && always() }}
151155
runs-on: ubuntu-latest
152156

153157
steps:
158+
- uses: actions/checkout@v4
154159
- name: Remove all artifacts
155160
uses: ./.github/actions/remove-artifacts

tests/e2e/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ remote
99
rihomedir
1010
rdi
1111
rte/rdi
12+
chrome_logs.txt

0 commit comments

Comments
 (0)