Files
puter/.github/workflows/test.yml
T
Nariman Jelveh 87ac67a340 Remove DevConsoleService and related dev console widgets (#2167)
* Remove DevConsoleService and related dev console widgets

Eliminates `DevConsoleService` and `NullDevConsoleService`, along with all code that registers or manages dev console widgets across the backend. Developer messages and notifications are now logged directly to the console. Removes related commands and test mocks, simplifying the developer experience and reducing code complexity.

* Remove MinLogService and related registration code

Deleted MinLogService.js and removed its registration from SelfHostedModule.js. This cleans up unused or deprecated logging functionality.

* Remove `DevSocketService` and related registration

* Increase test job timeouts in CI workflow

* Remove dev environment widget ops counter

Eliminated increment and decrement of the dev_batch-widget ops counter in BatchExecutor. This simplifies the code and removes dev-only UI tracking logic from the batch operation flow.

* Remove console Puter logo feature and related code

Deleted the src/fun/logos.js file and removed all references to the Puter logo display in WebServerService and documentation. This streamlines the server startup output and eliminates unused or unnecessary code.

* Update WebServerService.js

* Standardize console banner formatting in services
2025-12-13 13:31:16 -08:00

132 lines
3.6 KiB
YAML

name: test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test-backend:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Backend Tests (with coverage)
run: |
rm package-lock.json
npm install -g npm@latest
npm install
npm run build
npm run test:backend -- --coverage
- name: Upload backend coverage report
if: ${{ always() && hashFiles('coverage/**/coverage-summary.json') != '' }}
uses: actions/upload-artifact@v4
with:
name: backend-coverage-${{ matrix.node-version }}
path: coverage
retention-days: 5
- name: Publish backend coverage summary
if: ${{ always() && matrix.node-version == '22.x' }}
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const globModule = require('glob');
const matches = globModule.sync('coverage/**/coverage-summary.json', {
cwd: process.cwd(),
ignore: ['**/node_modules/**'],
});
if (!matches.length) {
core.warning('Coverage summary not found (expected coverage/**/coverage-summary.json). Did Vitest run with --coverage and include the json-summary reporter?');
return;
}
const summaryPath = path.resolve(matches[0]);
const summary = JSON.parse(fs.readFileSync(summaryPath, 'utf8'));
const metrics = ['lines', 'statements', 'branches', 'functions']
.map((key) => ({
label: key.charAt(0).toUpperCase() + key.slice(1),
...summary.total[key],
}));
core.summary
.addHeading('Backend coverage')
.addTable([
['Metric', 'Covered', 'Total', 'Pct'],
...metrics.map(({ label, covered, total, pct }) => [
label,
`${covered}`,
`${total}`,
`${pct}%`,
]),
])
.addRaw('Full HTML report is available in the uploaded `backend-coverage-${{ matrix.node-version }}` artifact.')
.write();
api-test:
name: API tests (node env, api-test)
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: API Test
run: |
pip install -r ./tests/ci/requirements.txt
./tests/ci/api-test.py
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: (api-test) server-logs
path: /tmp/backend.log
retention-days: 3
vitest:
name: puterjs (node env, vitest)
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Vitest Test
run: |
pip install -r ./tests/ci/requirements.txt
./tests/ci/vitest.py