feat: support msedge-dev installation (#7679)

Fixes #7677
This commit is contained in:
Andrey Lushnikov 2021-07-16 08:56:51 -08:00 committed by GitHub
parent 272759f296
commit 865aff8c9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 139 additions and 4 deletions

View File

@ -66,3 +66,75 @@ jobs:
- run: node lib/cli/cli install-deps
- run: node lib/cli/cli install
- run: npm run ttest
edge_dev_mac:
name: "Edge Dev (Mac)"
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- run: npm ci
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- run: node lib/cli/cli install msedge-dev
- run: npm run ctest
env:
PWTEST_CHANNEL: msedge-dev
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
name: msedge-dev-mac-test-results
path: test-results
edge_dev_win:
name: "Edge Dev (Win)"
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- run: npm ci
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- run: node lib/cli/cli install msedge-dev
- run: npm run ctest
shell: bash
env:
PWTEST_CHANNEL: msedge-dev
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
name: edge-dev-win-test-results
path: test-results
edge_dev_linux:
name: "Edge Dev (Linux)"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- run: npm ci
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- run: node lib/cli/cli install msedge-dev
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest
env:
PWTEST_CHANNEL: msedge-dev
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
if: always()
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
name: edge-dev-linux-test-results
path: test-results

View File

@ -10,7 +10,7 @@ $arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
Remove-Item $msiInstaller
$suffix = "\\Microsoft\\Edge\\Application\\msedge.exe"
$suffix = "\\Microsoft\\Edge Beta\\Application\\msedge.exe"
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
(Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
} elseif (Test-Path "${env:ProgramFiles}$suffix") {

View File

@ -0,0 +1,23 @@
#!/bin/bash
set -e
set -x
is_user_root () { [ "${EUID:-$(id -u)}" -eq 0 ]; }
if is_user_root; then
maybesudo=""
else
maybesudo="sudo"
fi
if dpkg --get-selections | grep -q "^microsoft-edge-dev[[:space:]]*install$" >/dev/null; then
$maybesudo apt-get remove -y microsoft-edge-dev
fi
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
$maybesudo install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
$maybesudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
rm /tmp/microsoft.gpg
$maybesudo apt-get update && $maybesudo apt-get install -y microsoft-edge-dev
microsoft-edge-dev --version

11
bin/reinstall_msedge_dev_mac.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
set -x
cd /tmp
curl -o ./msedge_dev.pkg -k "$1"
# Note: there's no way to uninstall previously installed MSEdge.
# However, running PKG again seems to update installation.
sudo installer -pkg /tmp/msedge_dev.pkg -target /
rm -rf /tmp/msedge_dev.pkg
/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev --version

View File

@ -0,0 +1,21 @@
$url = $args[0]
Write-Host "Downloading Microsoft Edge Dev"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-dev.msi"
$wc.Downloadfile($url, $msiInstaller)
Write-Host "Installing Microsoft Edge Dev"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
Remove-Item $msiInstaller
$suffix = "\\Microsoft\\Edge Dev\\Application\\msedge.exe"
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
(Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
(Get-Item "${env:ProgramFiles}$suffix").VersionInfo
} else {
write-host "ERROR: failed to install Microsoft Edge"
exit 1
}

View File

@ -340,7 +340,11 @@ export class Registry {
'linux': '/opt/microsoft/msedge-dev/msedge',
'darwin': '/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev',
'win32': `\\Microsoft\\Edge Dev\\Application\\msedge.exe`,
}));
}, () => this._installMSEdgeChannel('msedge-dev', {
'darwin': 'reinstall_msedge_dev_mac.sh',
'linux': 'reinstall_msedge_dev_linux.sh',
'win32': 'reinstall_msedge_dev_win.ps1',
})));
this._executables.push(this._createChromiumChannel('msedge-canary', {
'linux': '',
@ -561,11 +565,15 @@ export class Registry {
await fs.promises.writeFile(markerFilePath(descriptor.dir), '');
}
private async _installMSEdgeChannel(channel: string, scripts: Record<'linux' | 'darwin' | 'win32', string>) {
private async _installMSEdgeChannel(channel: 'msedge'|'msedge-beta'|'msedge-dev', scripts: Record<'linux' | 'darwin' | 'win32', string>) {
const scriptArgs: string[] = [];
if (process.platform !== 'linux') {
const products = JSON.parse(await fetchData('https://edgeupdates.microsoft.com/api/products'));
const productName = channel === 'msedge' ? 'Stable' : 'Beta';
const productName = {
'msedge': 'Stable',
'msedge-beta': 'Beta',
'msedge-dev': 'Dev',
}[channel];
const product = products.find((product: any) => product.Product === productName);
const searchConfig = ({
darwin: {platform: 'MacOS', arch: 'universal', artifact: 'pkg'},