mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 20:01:28 +00:00
add: hooks component add support for hooks within bruno-lang fix: hooks is not getting save hooks implemtation add hooks component within folders, requests add: quick js shims for hooks fix: garbage collected hook managers send logs to main rm: hook manager store feat: introduce HOOK_EVENTS constant for improved hook management add folder start/end events add folder run events rm: folder run related events add cli support for hooks support script:hooks instead of hooks move hooks to script tab make outer scope available within callback in safemode added runner, req apis as an abstraction over event based hooks fix: crash while editing folder hooks rm: unused files fix: self review changes refactor, request specific hook manager deleted once add: cm rm: spaces add prompt var rm: indent fix: lint refactor: shims handling for hooks fix: enable async calling in dev mode for gui, cli fix: support async callbacks within safe mode rm: vm instance fix: review comments fix: review comments add cli tests for hooks rm: client certs fix: add hooks to oc yaml fix: rename uid ot path name for better clarity, app crash when saving folder hooks rm: console rm: vm2 runtime leftover rm: check add: handler cleanup function add: playwright test case for hooks rm: review fixes fix: review comments add fallback hook manager add fallback hook manager fix: show error from hooks scripts within response pane change: collection events name feat: add name spaced hooks fix: review comments add: hooks specific collection for testing use hooks manager as a private field fix: tests use collection from bruno-test within playwright rm: databuffer test fix: playwright test rm: unintended changes rm: file
160 lines
5.3 KiB
YAML
160 lines
5.3 KiB
YAML
name: Tests
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
unit-test:
|
|
name: Unit Tests
|
|
timeout-minutes: 60
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-node@v5
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
cache-dependency-path: './package-lock.json'
|
|
- name: Install dependencies
|
|
run: npm ci --legacy-peer-deps
|
|
|
|
# build libraries
|
|
- name: Build libraries
|
|
run: |
|
|
npm run build --workspace=packages/bruno-common
|
|
npm run build --workspace=packages/bruno-query
|
|
npm run sandbox:bundle-libraries --workspace=packages/bruno-js
|
|
npm run build --workspace=packages/bruno-converters
|
|
npm run build --workspace=packages/bruno-requests
|
|
npm run build --workspace=packages/bruno-schema-types
|
|
npm run build --workspace=packages/bruno-filestore
|
|
|
|
- name: Lint Check
|
|
run: npm run lint
|
|
env:
|
|
ESLINT_PLUGIN_DIFF_COMMIT: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}
|
|
|
|
# tests
|
|
- name: Test Package bruno-js
|
|
run: npm run test --workspace=packages/bruno-js
|
|
- name: Test Package bruno-cli
|
|
run: npm run test --workspace=packages/bruno-cli
|
|
|
|
- name: Test Package bruno-query
|
|
run: npm run test --workspace=packages/bruno-query
|
|
- name: Test Package bruno-lang
|
|
run: npm run test --workspace=packages/bruno-lang
|
|
- name: Test Package bruno-schema
|
|
run: npm run test --workspace=packages/bruno-schema
|
|
- name: Test Package bruno-app
|
|
run: npm run test --workspace=packages/bruno-app
|
|
- name: Test Package bruno-common
|
|
run: npm run test --workspace=packages/bruno-common
|
|
- name: Test Package bruno-converters
|
|
run: npm run test --workspace=packages/bruno-converters
|
|
- name: Test Package bruno-electron
|
|
run: npm run test --workspace=packages/bruno-electron
|
|
- name: Test Package bruno-requests
|
|
run: npm run test --workspace=packages/bruno-requests
|
|
|
|
cli-test:
|
|
name: CLI Tests
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
checks: write
|
|
pull-requests: write
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-node@v5
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
cache-dependency-path: './package-lock.json'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --legacy-peer-deps
|
|
|
|
- name: Build Libraries
|
|
run: |
|
|
npm run build --workspace=packages/bruno-query
|
|
npm run build --workspace=packages/bruno-common
|
|
npm run sandbox:bundle-libraries --workspace=packages/bruno-js
|
|
npm run build --workspace=packages/bruno-converters
|
|
npm run build --workspace=packages/bruno-requests
|
|
npm run build --workspace=packages/bruno-schema-types
|
|
npm run build --workspace=packages/bruno-filestore
|
|
|
|
- name: Run Local Testbench
|
|
run: |
|
|
npm start --workspace=packages/bruno-tests &
|
|
sleep 5
|
|
|
|
- name: Run tests
|
|
run: |
|
|
cd packages/bruno-tests/collection
|
|
npm install
|
|
node ../../bruno-cli/bin/bru.js run --env Prod --output junit.xml --format junit --sandbox developer
|
|
|
|
- name: Run comprehensive hooks tests
|
|
run: |
|
|
cd packages/bruno-tests/hooks-comprehensive-tests
|
|
node ../../bruno-cli/bin/bru.js run --env Prod --output junit-hooks.xml --format junit
|
|
|
|
- name: Publish Test Report
|
|
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
if: always()
|
|
with:
|
|
check_name: CLI Test Results
|
|
files: |
|
|
packages/bruno-tests/collection/junit.xml
|
|
packages/bruno-tests/hooks-comprehensive-tests/junit-hooks.xml
|
|
comment_mode: always
|
|
e2e-test:
|
|
name: Playwright E2E Tests
|
|
timeout-minutes: 60
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-node@v5
|
|
with:
|
|
node-version: v22.11.x
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get --no-install-recommends install -y \
|
|
libglib2.0-0 libnss3 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-0 libasound2t64 \
|
|
xvfb
|
|
npm ci --legacy-peer-deps
|
|
sudo chown root /home/runner/work/bruno/bruno/node_modules/electron/dist/chrome-sandbox
|
|
sudo chmod 4755 /home/runner/work/bruno/bruno/node_modules/electron/dist/chrome-sandbox
|
|
|
|
- name: Install dependencies for test collection environment
|
|
run: |
|
|
npm ci --prefix packages/bruno-tests/collection
|
|
|
|
- name: Build libraries
|
|
run: |
|
|
npm run build:graphql-docs
|
|
npm run build:bruno-query
|
|
npm run build:bruno-common
|
|
npm run sandbox:bundle-libraries --workspace=packages/bruno-js
|
|
npm run build:bruno-converters
|
|
npm run build:bruno-requests
|
|
npm run build:schema-types
|
|
npm run build:bruno-filestore
|
|
|
|
- name: Run Playwright tests
|
|
run: |
|
|
xvfb-run npm run test:e2e
|
|
- uses: actions/upload-artifact@v6
|
|
if: ${{ !cancelled() }}
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 30
|