Skip to content

Commit

Permalink
dx: [des] fix e2e test setup to work on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Dec 16, 2022
1 parent 0afa1f1 commit b4560bd
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// SPDX-FileCopyrightText: 2022 The Manyverse Authors
//
// SPDX-License-Identifier: Unlicense

PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
24 changes: 13 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
"node-gyp-build": "4.3.0",
"ora": "^5.4.1",
"patch-package": "6.4.7",
"playwright": "^1.28.1",
"playwright-core": "1.28.1",
"prettier": "~2.5.1",
"pretty-quick": "~3.1.3",
Expand Down
5 changes: 4 additions & 1 deletion test/e2e/desktop/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export default function setup(subtest?: string) {
const appInfo = parseElectronApp(latestBuild);
console.log = originalConsoleLog;
if (!appInfo.arch) appInfo.arch = 'x64';
if (!appInfo.executable.endsWith('/manyverse')) {
if (
appInfo.platform === 'linux' &&
!appInfo.executable.endsWith('/manyverse')
) {
appInfo.executable += '/manyverse';
}

Expand Down
21 changes: 14 additions & 7 deletions tools/test-e2e-desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

function cleanUp {
if [ -f "appium-server.pid" ]; then
if ps -p $(cat appium-server.pid)> /dev/null; then
if ps -p $(cat appium-server.pid) >/dev/null; then
kill -KILL $(cat appium-server.pid)
fi
rm appium-server.pid
Expand All @@ -25,14 +25,21 @@ function onFailure() {
exit 1
}

FILE=desktop/outputs/linux-unpacked/manyverse
if [[ -f "$FILE" ]]; then
echo "Desktop build already exists"
if [[ "$OSTYPE" == "darwin"* ]]; then
RELEASE_DESKTOP_SUFFIX="macos"
EXECUTABLE_FILE=desktop/outputs/mac/Manyverse.app/Contents/MacOS/Manyverse
else
echo "Desktop build does not exist, building now"
EB_PUBLISH=never npm run release-desktop-linux
RELEASE_DESKTOP_SUFFIX="linux"
EXECUTABLE_FILE=desktop/outputs/linux-unpacked/manyverse
fi

rm -rf /tmp/manyverse-e2e-test
if [[ -f "$EXECUTABLE_FILE" ]]; then
echo "Desktop build already exists"
else
echo "Desktop build does not exist, building now"
EB_PUBLISH=never npm run release-desktop-"$RELEASE_DESKTOP_SUFFIX"
fi

rm -rf "$TMPDIR/manyverse-e2e-test"

$(npm bin)/playwright test

0 comments on commit b4560bd

Please sign in to comment.