Skip to content

Commit 2ef39b2

Browse files
authored
Merge pull request #298 from bitfinexcom/staging
Release version 4.17.0
2 parents e3e2917 + 421401d commit 2ef39b2

22 files changed

Lines changed: 645 additions & 30 deletions

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ bfx-report-ui/build
1919
bfx-report-ui/bfx-report-express/logs/*.log
2020
bfx-report-ui/bfx-report-express/config/*.json
2121
stub.AppImage
22+
e2e-test-report.xml
23+
test-report.json
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: 'Prepare Mac runner'
2+
description: 'Turn uninterrupted testing on mac'
3+
runs:
4+
using: composite
5+
steps:
6+
- run: ${{ github.action_path }}/prepare-mac-runner.sh
7+
shell: bash
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
# Turn uninterrupted testing on mac
4+
5+
# Change Local name to avoid name clash causing alert
6+
uniqueComputerName="mac-e2e-test-runner-$RANDOM"
7+
sudo scutil --set LocalHostName "$uniqueComputerName"
8+
sudo scutil --set ComputerName "$uniqueComputerName"
9+
10+
# Close Notification window
11+
sudo killall UserNotificationCenter || true
12+
13+
# Do not disturb
14+
defaults -currentHost write com.apple.notificationcenterui doNotDisturb -boolean true
15+
defaults -currentHost write com.apple.notificationcenterui doNotDisturbDate -date "`date -u +\"%Y-%m-%d %H:%M:%S +0000\"`"
16+
sudo killall NotificationCenter
17+
18+
# Disable firewall
19+
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
20+
sudo /usr/libexec/ApplicationFirewall/socketfilterfw -k
21+
22+
# Close Finder Windows using Apple Script
23+
sudo osascript -e 'tell application "Finder" to close windows'

.github/workflows/build-electron-app.yml

Lines changed: 122 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-22.04
3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
with:
3535
submodules: recursive
3636
- name: Set repo owner
@@ -76,17 +76,31 @@ jobs:
7676
max_attempts: 3
7777
retry_on: any
7878
command: ./scripts/launch.sh -lwp
79+
- name: Zip Linux Unpacked build
80+
run: zip -r dist/linux-unpacked.zip dist/linux-unpacked
81+
- name: Upload Linux Unpacked build
82+
uses: actions/upload-artifact@v3
83+
with:
84+
name: linux-unpacked
85+
path: dist/linux-unpacked.zip
86+
- name: Zip Win Unpacked build
87+
run: zip -r dist/win-unpacked.zip dist/win-unpacked
88+
- name: Upload Win Unpacked build
89+
uses: actions/upload-artifact@v3
90+
with:
91+
name: win-unpacked
92+
path: dist/win-unpacked.zip
7993
- name: Prepare cache folders
8094
run: |
8195
sudo chown -R $(id -u):$(id -g) ~/.cache/electron
8296
sudo chown -R $(id -u):$(id -g) ~/.cache/electron-builder
8397
8498
mac-builder:
8599
timeout-minutes: 90
86-
runs-on: macos-11
100+
runs-on: macos-12
87101
steps:
88102
- name: Checkout
89-
uses: actions/checkout@v3
103+
uses: actions/checkout@v4
90104
with:
91105
submodules: recursive
92106
- name: Set repo owner
@@ -135,3 +149,108 @@ jobs:
135149
max_attempts: 3
136150
retry_on: any
137151
command: ./scripts/build-release.sh -mp
152+
- name: Zip Mac Unpacked build
153+
run: zip -r dist/mac.zip dist/mac
154+
- name: Upload Mac Unpacked build
155+
uses: actions/upload-artifact@v3
156+
with:
157+
name: mac-unpacked
158+
path: dist/mac.zip
159+
160+
linux-e2e-test-runner:
161+
name: Linux E2E Test Runner
162+
timeout-minutes: 30
163+
runs-on: ubuntu-22.04
164+
needs: [linux-win-docker-builder]
165+
steps:
166+
- name: Checkout
167+
uses: actions/checkout@v4
168+
- uses: actions/setup-node@v3
169+
with:
170+
node-version: 18.17.1
171+
- name: Install main dev deps
172+
run: npm i --development --no-audit --progress=false --force
173+
- name: Download Linux Unpacked build
174+
uses: actions/download-artifact@v3
175+
with:
176+
name: linux-unpacked
177+
path: dist
178+
- name: Unzip Linux Unpacked build
179+
run: unzip dist/linux-unpacked.zip
180+
- name: Run tests
181+
uses: coactions/setup-xvfb@v1.0.1
182+
with:
183+
run: npm run e2e
184+
- name: Normalize E2E test report
185+
run: node ./scripts/node/normalize-e2e-test-report e2e-test-report.xml
186+
- name: Upload Linux E2E test results
187+
uses: actions/upload-artifact@v3
188+
with:
189+
name: linux-e2e-test-results
190+
path: e2e-test-report.xml
191+
192+
win-e2e-test-runner:
193+
name: Win E2E Test Runner
194+
timeout-minutes: 30
195+
runs-on: windows-2022
196+
needs: [linux-win-docker-builder]
197+
steps:
198+
- name: Checkout
199+
uses: actions/checkout@v4
200+
- uses: actions/setup-node@v3
201+
with:
202+
node-version: 18.17.1
203+
- name: Install main dev deps
204+
run: npm i --development --no-audit --progress=false --force
205+
- name: Download Linux Unpacked build
206+
uses: actions/download-artifact@v3
207+
with:
208+
name: win-unpacked
209+
path: dist
210+
- name: Unzip Win Unpacked build
211+
run: 7z -y x dist/win-unpacked.zip
212+
- name: Run tests
213+
uses: coactions/setup-xvfb@v1.0.1
214+
with:
215+
run: npm run e2e
216+
- name: Normalize E2E test report
217+
run: node ./scripts/node/normalize-e2e-test-report e2e-test-report.xml
218+
- name: Upload Win E2E test results
219+
uses: actions/upload-artifact@v3
220+
with:
221+
name: win-e2e-test-results
222+
path: e2e-test-report.xml
223+
224+
mac-e2e-test-runner:
225+
name: Mac E2E Test Runner
226+
timeout-minutes: 30
227+
runs-on: macos-12
228+
needs: [mac-builder]
229+
steps:
230+
- name: Checkout
231+
uses: actions/checkout@v4
232+
- name: Prepare Mac runner
233+
uses: ./.github/actions/prepare-mac-runner
234+
- uses: actions/setup-node@v3
235+
with:
236+
node-version: 18.17.1
237+
- name: Install main dev deps
238+
run: npm i --development --no-audit --progress=false --force
239+
- name: Download Mac Unpacked build
240+
uses: actions/download-artifact@v3
241+
with:
242+
name: mac-unpacked
243+
path: dist
244+
- name: Unzip Mac Unpacked build
245+
run: unzip dist/mac.zip
246+
- name: Run tests
247+
uses: coactions/setup-xvfb@v1.0.1
248+
with:
249+
run: npm run e2e
250+
- name: Normalize E2E test report
251+
run: node ./scripts/node/normalize-e2e-test-report e2e-test-report.xml
252+
- name: Upload Mac E2E test results
253+
uses: actions/upload-artifact@v3
254+
with:
255+
name: mac-e2e-test-results
256+
path: e2e-test-report.xml
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 'E2E Test Report'
2+
run-name: 'E2E Test Report: Commit ${{ github.sha }}'
3+
4+
on:
5+
workflow_run:
6+
workflows: ['Build release']
7+
types:
8+
- completed
9+
10+
permissions:
11+
contents: read
12+
actions: read
13+
checks: write
14+
15+
jobs:
16+
e2e-web-page-report:
17+
name: E2E Web Page Report
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- uses: dorny/test-reporter@v1
21+
id: linux-e2e-test-results
22+
with:
23+
artifact: linux-e2e-test-results
24+
name: Linux E2E Tests
25+
path: e2e-test-report.xml
26+
reporter: jest-junit
27+
- uses: dorny/test-reporter@v1
28+
id: win-e2e-test-results
29+
with:
30+
artifact: win-e2e-test-results
31+
name: Win E2E Tests
32+
path: e2e-test-report.xml
33+
reporter: jest-junit
34+
- uses: dorny/test-reporter@v1
35+
id: mac-e2e-test-results
36+
with:
37+
artifact: mac-e2e-test-results
38+
name: Mac E2E Tests
39+
path: e2e-test-report.xml
40+
reporter: jest-junit
41+
- name: E2E Test Report Summary
42+
run: |
43+
echo "### E2E Test Report page is ready! :rocket:" >> $GITHUB_STEP_SUMMARY
44+
echo "And available at the following links for applicable OSs:" >> $GITHUB_STEP_SUMMARY
45+
echo "- [Linux](${{ steps.linux-e2e-test-results.outputs.url_html }})" >> $GITHUB_STEP_SUMMARY
46+
echo "- [Win](${{ steps.win-e2e-test-results.outputs.url_html }})" >> $GITHUB_STEP_SUMMARY
47+
echo "- [Mac](${{ steps.mac-e2e-test-results.outputs.url_html }})" >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ package-lock.json
1313
lastCommit.json
1414
electronEnv.json
1515
stub.AppImage
16+
e2e-test-report.xml
17+
test-report.json

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [4.17.0] - 2024-01-10
11+
12+
### Added
13+
14+
- Added ability to define what kind of API keys are stored `prod`/`staging`. The `prod`/`staging` is detected by existing the `staging` string in the restUrl config option: `https://api-pub.bitfinex.com`/`https://api.staging.bitfinex.com`. And `isStagingBfxApi` flag is set or updated on `signUp`/`signIn` to the `user` table. Than, `getUsers` endpoint will return the `isStagingBfxApi` flag to be shown in the UI for each user on the login stage. PR: [bfx-reports-framework#347](https://github.com/bitfinexcom/bfx-reports-framework/pull/347)
15+
- Added automated testing for electron app binaries. The flow: build release on GitHub Actions, use unpacked builds for E2E tests, launch E2E test on Linux and Mac and Win OSs independently, provide E2E test reports for every OS launch. PR: [bfx-report-electron#276](https://github.com/bitfinexcom/bfx-report-electron/pull/276)
16+
17+
### Fixed
18+
19+
- Fixed `parentCellHeight` related warnings for the several column configurations. PR: [bfx-report-ui#749](https://github.com/bitfinexcom/bfx-report-ui/pull/749)
20+
- Fixes skipping publishing of artifact for `Mac` by `electron-builder`. The issue came from this PR of `electron-builder`: [electron-builder#7715](https://github.com/electron-userland/electron-builder/pull/7715). PR: [bfx-report-electron#290](https://github.com/bitfinexcom/bfx-report-electron/pull/290)
21+
22+
### Security
23+
24+
- Replaced `Lodash` `_isEqual` helper usage all across the app with the corresponding one from the internal library for security reasons. PR: [bfx-report-ui#750](https://github.com/bitfinexcom/bfx-report-ui/pull/750)
25+
- Resolved `dependabot` dependency updates: [bfx-report-electron#269](https://github.com/bitfinexcom/bfx-report-electron/pull/269), [bfx-report-electron#270](https://github.com/bitfinexcom/bfx-report-electron/pull/270), [bfx-report-electron#272](https://github.com/bitfinexcom/bfx-report-electron/pull/272), [bfx-report-electron#273](https://github.com/bitfinexcom/bfx-report-electron/pull/273), [bfx-report-electron#280](https://github.com/bitfinexcom/bfx-report-electron/pull/280). PR: [bfx-report-electron#289](https://github.com/bitfinexcom/bfx-report-electron/pull/289)
26+
1027
## [4.16.0] - 2023-12-13
1128

1229
### Added

electron-builder-config.js

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const exec = promisify(require('child_process').exec)
99

1010
let version
1111
let zippedAppImageArtifactPath
12+
let zippedMacArtifactPath
1213
const appOutDirs = new Map()
1314

1415
/* eslint-disable no-template-curly-in-string */
@@ -107,6 +108,10 @@ module.exports = {
107108
'build/icon.*',
108109
'build/loader.*',
109110
'!scripts${/*}',
111+
'!test/${/*}',
112+
'!electronEnv.json.example',
113+
'!e2e-test-report.xml',
114+
'!wdio.conf.js',
110115

111116
'!bfx-report-ui',
112117
'bfx-report-ui/build',
@@ -133,6 +138,8 @@ module.exports = {
133138
'!**/LICENSE.md',
134139
'!**/.gitmodules',
135140
'!**/.npmrc',
141+
'!**/.mocharc.json',
142+
'!**/.github/${/*}',
136143
{
137144
from: 'bfx-reports-framework/node_modules',
138145
to: 'bfx-reports-framework/node_modules',
@@ -143,6 +150,16 @@ module.exports = {
143150
to: 'bfx-report-ui/bfx-report-express/node_modules',
144151
filter: nodeModulesFilter
145152
},
153+
{
154+
from: 'node_modules/wdio-electron-service',
155+
to: 'node_modules/wdio-electron-service',
156+
filter: nodeModulesFilter
157+
},
158+
{
159+
from: 'node_modules/wdio-electron-service/node_modules',
160+
to: 'node_modules/wdio-electron-service/node_modules',
161+
filter: nodeModulesFilter
162+
},
146163
...getNodeModulesSubSources('bfx-reports-framework'),
147164
...getNodeModulesSubSources('bfx-report-ui/bfx-report-express')
148165
],
@@ -189,24 +206,25 @@ module.exports = {
189206
!targets.has('zip')
190207
) {
191208
targets.set('zip', {})
192-
artifactPaths.push(path.join(
193-
outDir,
194-
`BitfinexReport-${version}-x64-${targetPlatform}.zip`
195-
))
196209
}
197210

198211
for (const [targetName] of targets) {
199212
const ext = targetName === 'nsis'
200213
? 'exe'
201214
: targetName
202-
const appFilePath = artifactPaths.find((path) => (
215+
const foundAppFilePath = artifactPaths.find((path) => (
203216
new RegExp(`${targetPlatform}.*${ext}$`, 'i').test(path)
204217
))
218+
const appFilePath = foundAppFilePath ?? path.join(
219+
outDir,
220+
`BitfinexReport-${version}-x64-${targetPlatform}.${ext}`
221+
)
205222

206223
if (
207224
targetPlatform === 'mac' &&
208225
targetName === 'zip'
209226
) {
227+
zippedMacArtifactPath = appFilePath
210228
macBlockmapFilePaths.push(
211229
`${appFilePath}.blockmap`,
212230
path.join(outDir, `${channel}-mac.yml`)
@@ -283,7 +301,7 @@ module.exports = {
283301
}
284302

285303
const macFiles = macBlockmapFilePaths.length > 0
286-
? [...artifactPaths, ...macBlockmapFilePaths]
304+
? [zippedMacArtifactPath, ...macBlockmapFilePaths]
287305
: []
288306
const linuxFiles = zippedAppImageArtifactPath
289307
? [zippedAppImageArtifactPath]

0 commit comments

Comments
 (0)