From 672e211067c4ef696459de9071f3a6d02bacbfe1 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 19 Mar 2024 08:46:36 +0100 Subject: [PATCH] test isogit --- .circleci/config.yml | 5 +++-- apps/remixdesktop/package.json | 1 + apps/remixdesktop/src/plugins/isoGitPlugin.ts | 6 ++++-- apps/remixdesktop/test/nighwatch.app.ts | 4 ++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f9e487c21..f0fe9281e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -130,7 +130,7 @@ jobs: name: "Run tests" command: | cd apps/remixdesktop/ - yarn run build:e2e && yarn run test + yarn run build:e2e && yarn run test && yarn run test:isogit build-remixdesktop-linux: machine: @@ -268,6 +268,7 @@ jobs: yarn -v sleep 15 yarn run test + yarn run test:isogit shell: powershell.exe # see https://docs.digicert.com/en/software-trust-manager/ci-cd-integrations/script-integrations/github-integration-ksp.html sign-remixdesktop-windows: @@ -507,7 +508,7 @@ jobs: command: | nvm use 20 cd apps/remixdesktop - yarn run test + yarn run test && yarn run test:isogit uploadartifacts: docker: diff --git a/apps/remixdesktop/package.json b/apps/remixdesktop/package.json index cbb4ece79b..51e774dc1a 100644 --- a/apps/remixdesktop/package.json +++ b/apps/remixdesktop/package.json @@ -29,6 +29,7 @@ "installRipGrepMacOXarm64": "rm -rf node_modules/@vscode/ripgrep/bin && npm_config_arch=arm64 node node_modules/@vscode/ripgrep/lib/postinstall.js", "postinstall": "electron-builder install-app-deps", "test": "yarn run build:e2e && nightwatch --config build-e2e/remixdesktop/test/nighwatch.app.js", + "test:isogit": "yarn run test --useIsoGit --test build-e2e/remixdesktop/test/tests/app/git.test.js", "build:e2e": "tsc -p tsconfig.e2e.json" }, "devDependencies": { diff --git a/apps/remixdesktop/src/plugins/isoGitPlugin.ts b/apps/remixdesktop/src/plugins/isoGitPlugin.ts index 62a3451a63..283cad0778 100644 --- a/apps/remixdesktop/src/plugins/isoGitPlugin.ts +++ b/apps/remixdesktop/src/plugins/isoGitPlugin.ts @@ -12,7 +12,8 @@ const profile: Profile = { displayName: 'isogit', description: 'isogit plugin', } - +// used in e2e tests +const useIsoGit = process.argv.includes('--useIsoGit'); export class IsoGitPlugin extends ElectronBasePlugin { clients: IsoGitPluginClient[] = [] constructor() { @@ -60,7 +61,7 @@ class IsoGitPluginClient extends ElectronBasePluginClient { this.gitIsInstalled = await gitProxy.version() ? true : false }) this.workingDir = await this.call('fs' as any, 'getWorkingDir') - this.gitIsInstalled = await gitProxy.version() ? true : false + this.gitIsInstalled = await gitProxy.version() && !useIsoGit ? true : false }) } @@ -335,6 +336,7 @@ class IsoGitPluginClient extends ElectronBasePluginClient { } } else { try { + this.call('terminal' as any, 'log', 'Cloning using builtin git... please wait.') const clone = await git.clone({ ...await this.getGitConfig(), ...cmd, diff --git a/apps/remixdesktop/test/nighwatch.app.ts b/apps/remixdesktop/test/nighwatch.app.ts index dd2b492748..1338e4fe0b 100644 --- a/apps/remixdesktop/test/nighwatch.app.ts +++ b/apps/remixdesktop/test/nighwatch.app.ts @@ -2,6 +2,8 @@ const os = require('os'); const http = require('http'); +const useIsoGit = process.argv.includes('--useIsoGit'); + // Function to check if localhost:8080 is active function checkLocalhost8080Active(callback) { const options = { @@ -81,6 +83,8 @@ module.exports = { // Check if running on CircleCI or locally let args = process.env.CIRCLECI ? ["--e2e"] : ["--e2e-local"]; + if(useIsoGit) args = [...args, '--useIsoGit']; + if(!process.env.CIRCLECI){ checkLocalhost8080Active((isActive)=>{ if(!isActive){