-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add operate setup test #172
Merged
+2,446
−164
Merged
Changes from 17 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
6cb4e9e
test: operate installation e2e
angrybayblade 97a3142
chore: add e2e test workflow
angrybayblade 812f872
fix: test job
angrybayblade 8a2fe9a
feat: add macos arm runner
angrybayblade aa6dddd
feat: add IPC channel mock
angrybayblade cc67cd1
fix: macos arm version
angrybayblade 6d236e1
fix: uninstall brew
angrybayblade 23e3c99
fix: use sudo for uninstalling brew
angrybayblade 2187725
chore: add brew installation logging
angrybayblade d6256b9
feat: add brew installation script and fix tendermint installation
angrybayblade c037b3e
fix: __dirname typo
angrybayblade 1abb697
fix: raise condition for command exec result
angrybayblade 0f6803c
fix: skip tendermint installation in CI
angrybayblade 3c42801
feat: extend e2e tests
angrybayblade 91b980d
chore: ignore jinja safety warning
angrybayblade 734b967
chore: ignore gitleaks warnings
angrybayblade e67e092
chore: remove debug statement
angrybayblade e879153
feat: bump to rc37
angrybayblade 5f3095e
fix: write script to temporary file for installing brew
angrybayblade 4de8070
feat: bump to v0.1.0-rc38
angrybayblade 14615fe
fix: use js strings to store brew installation script
angrybayblade 27c1508
Merge branch 'main' into fix/brew-installation
angrybayblade 879862f
fix: script multiline
angrybayblade 8783c07
feat: bump to v0.1.0-rc39
angrybayblade 579fd78
fix: store the temporary brew script in homedir instead of tempdir
angrybayblade 47d4ab2
feat: install brew from source
angrybayblade 5d7333b
fix: homebrew source extraction and sudo cmd exec
angrybayblade 259ef3c
fix: env name typo
angrybayblade 5237df7
fix: remove unwanted code
angrybayblade 3962a76
fix: tendermint installation
angrybayblade b7bb6c6
fix: remove homebrew leftovers from uninstall
angrybayblade c848a8f
feat: bump to v0.1.0-rc40
angrybayblade 01084f7
fix: use rmDirSync instead of rmSync
angrybayblade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: "Test Operate Installation E2E" | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
- main | ||
pull_request: | ||
jobs: | ||
test: | ||
continue-on-error: False | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-12, macos-14] | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20.11" | ||
- name: Setup | ||
run: | | ||
npm install | ||
# Uninstall brew | ||
sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" | ||
- name: Run Test | ||
run: | | ||
node electron/test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
// Installation helpers. | ||
|
||
const https = require('https'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const os = require('os'); | ||
const sudo = require('sudo-prompt'); | ||
|
@@ -87,11 +85,9 @@ function runCmdUnix(command, options) { | |
Error: ${output.error}; Stdout: ${output.stdout}; Stderr: ${output.stderr}`, | ||
); | ||
} | ||
return { | ||
error: output.error, | ||
stdout: output.stdout?.toString(), | ||
stderr: output.stderr?.toString(), | ||
}; | ||
console.log(appendLog(`Executed ${command} ${options} with`)) | ||
console.log(appendLog(`===== stdout ===== \n${output.stdout}`)) | ||
console.log(appendLog(`===== stderr ===== \n${output.stderr}`)) | ||
} | ||
|
||
function runSudoUnix(command, options) { | ||
|
@@ -119,9 +115,8 @@ function isBrewInstalled() { | |
} | ||
|
||
function installBrew() { | ||
return runCmdUnix('bash', [ | ||
'-c', | ||
'$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)', | ||
runCmdUnix('bash', [ | ||
`${__dirname}/scripts/install_brew.sh` | ||
]); | ||
} | ||
|
||
|
@@ -143,7 +138,7 @@ async function downloadFile(url, dest) { | |
writer.on('error', reject); | ||
}); | ||
} catch (err) { | ||
fs.unlink(dest, () => {}); // Delete the file if there is an error | ||
fs.unlink(dest, () => { }); // Delete the file if there is an error | ||
console.error('Error downloading the file:', err.message); | ||
} | ||
} | ||
|
@@ -161,8 +156,12 @@ async function installTendermintUnix() { | |
await downloadFile(url, `${TempDir}/tendermint.tar.gz`); | ||
|
||
console.log(appendLog(`Installing tendermint binary`)); | ||
await runCmdUnix('tar', ['-xvf', 'tendermint.tar.gz']); | ||
await runSudoUnix('install', 'tendermint /usr/local/bin'); | ||
runCmdUnix('tar', ['-xvf', 'tendermint.tar.gz']); | ||
|
||
// TOFIX: Install tendermint in .operate instead of globally | ||
if (!Env.CI) { | ||
await runSudoUnix('install', 'tendermint /usr/local/bin'); | ||
} | ||
process.chdir(cwd); | ||
} | ||
|
||
|
@@ -171,7 +170,7 @@ function isDockerInstalledDarwin() { | |
} | ||
|
||
function installDockerDarwin() { | ||
return runCmdUnix('brew', ['install', 'docker']); | ||
runCmdUnix('brew', ['install', 'docker']); | ||
} | ||
|
||
function isDockerInstalledUbuntu() { | ||
|
@@ -187,11 +186,11 @@ function isPythonInstalledDarwin() { | |
} | ||
|
||
function installPythonDarwin() { | ||
return runCmdUnix('brew', ['install', '[email protected]']); | ||
runCmdUnix('brew', ['install', '[email protected]']); | ||
} | ||
|
||
function createVirtualEnvUnix(path) { | ||
return runCmdUnix('python3.10', ['-m', 'venv', path]); | ||
runCmdUnix('python3.10', ['-m', 'venv', path]); | ||
} | ||
|
||
function isPythonInstalledUbuntu() { | ||
|
@@ -211,11 +210,11 @@ function installGitUbuntu() { | |
} | ||
|
||
function createVirtualEnvUbuntu(path) { | ||
return runCmdUnix('python3.10', ['-m', 'venv', path]); | ||
runCmdUnix('python3.10', ['-m', 'venv', path]); | ||
} | ||
|
||
function installOperatePackageUnix(path) { | ||
return runCmdUnix(`${path}/venv/bin/python3.10`, [ | ||
runCmdUnix(`${path}/venv/bin/python3.10`, [ | ||
'-m', | ||
'pip', | ||
'install', | ||
|
@@ -225,7 +224,7 @@ function installOperatePackageUnix(path) { | |
|
||
function reInstallOperatePackageUnix(path) { | ||
console.log(appendLog('Reinstalling pearl CLI')); | ||
return runCmdUnix(`${path}/venv/bin/python3.10`, [ | ||
runCmdUnix(`${path}/venv/bin/python3.10`, [ | ||
'-m', | ||
'pip', | ||
'install', | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macos-12
isamd
based andmacos-14
isarm
based