Skip to content

Commit de13502

Browse files
committed
revert e2e appimage sso sh script
1 parent 730ae86 commit de13502

File tree

2 files changed

+70
-45
lines changed

2 files changed

+70
-45
lines changed

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

Lines changed: 16 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,25 @@
11
#!/bin/bash
22
set -e
33

4-
yarn --cwd tests/e2e install
4+
ARCH=${ARCH:-x86_64}
5+
WORKING_DIRECTORY=$(pwd)
6+
SOURCE_APP=${SOURCE_APP:-"Redis-Insight-linux-$ARCH.AppImage"}
7+
RI_APP_FOLDER_NAME="Redis-Insight-linux"
8+
TAR_NAME="Redis-Insight-app-linux.$ARCH.tar.gz"
9+
TMP_FOLDER="/tmp/Redis-Insight-app-$ARCH"
510

6-
# Create the ri-test directory if it doesn't exist
7-
mkdir -p ri-test
11+
rm -rf "$TMP_FOLDER"
812

9-
# Extract the AppImage
10-
chmod +x ./release/*.AppImage
11-
./release/*.AppImage --appimage-extract
13+
mkdir -p "$WORKING_DIRECTORY/release/redisstack"
14+
mkdir -p "$TMP_FOLDER"
1215

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+
cp "./release/$SOURCE_APP" "$TMP_FOLDER"
17+
cd "$TMP_FOLDER" || exit 1
1618

17-
# Export custom XDG_DATA_DIRS with ri-test
18-
export XDG_DATA_DIRS="$(pwd)/ri-test:$XDG_DATA_DIRS"
19+
./"$SOURCE_APP" --appimage-extract
20+
mv squashfs-root "$RI_APP_FOLDER_NAME"
1921

20-
# create folder before tests run to prevent permissions issue
21-
mkdir -p tests/e2e/remote
22-
mkdir -p tests/e2e/rdi
22+
tar -czvf "$TAR_NAME" "$RI_APP_FOLDER_NAME"
2323

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
48-
./tests/e2e/wait-for-redis.sh localhost 12000 && \
49-
50-
# Run tests
51-
COMMON_URL=$(pwd)/ri-test/resources/app.asar/dist/renderer/index.html \
52-
ELECTRON_PATH=$(pwd)/ri-test/redisinsight \
53-
RI_SOCKETS_CORS=true \
54-
yarn --cwd tests/e2e dotenv -e .desktop.env yarn --cwd tests/e2e test:desktop:ci
24+
cp "$TAR_NAME" "$WORKING_DIRECTORY/release/redisstack/"
25+
cd "$WORKING_DIRECTORY" || exit 1

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
set -e
3+
4+
yarn --cwd tests/e2e install
5+
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"
19+
20+
# create folder before tests run to prevent permissions issue
21+
mkdir -p tests/e2e/remote
22+
mkdir -p tests/e2e/rdi
23+
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
48+
./tests/e2e/wait-for-redis.sh localhost 12000 && \
49+
50+
# Run tests
51+
COMMON_URL=$(pwd)/ri-test/resources/app.asar/dist/renderer/index.html \
52+
ELECTRON_PATH=$(pwd)/ri-test/redisinsight \
53+
RI_SOCKETS_CORS=true \
54+
yarn --cwd tests/e2e dotenv -e .desktop.env yarn --cwd tests/e2e test:desktop:ci

0 commit comments

Comments
 (0)