Skip to content

Commit

Permalink
Call memory test directly (#1221)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekevinscott authored Oct 14, 2023
1 parent 6749865 commit 6f33f91
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ jobs:
with:
node-version: 16

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# detached: true

- name: 'Integration Tests'
run: pnpm test:integration:serverside -- --ci --verbose
Expand Down Expand Up @@ -289,7 +289,7 @@ jobs:
node-version: 16

- name: 'Memory Leak Tests'
run: pnpm test:integration:memory-leaks -- --ci --verbose
run: pnpm test:integration:memory-leaks

build-docs:
name: 'Build Documentation'
Expand Down
1 change: 1 addition & 0 deletions internals/common/src/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const pnpmInstall = async (cwd: string, _opts = {}) => {
'pnpm',
'install',
'--ignore-scripts',
'--fix-lockfile'
// isSilent ? '--silent' : '',
// '--no-fund',
// '--no-audit',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
]
},
"test:integration:memory-leaks": {
"command": "pnpm --filter @upscalerjs/scripts test:integration:memory-leaks",
"command": "ESBUILD_DIST_FOLDER=./tmp/bundlers/esbuild/dist vitest -c ./test/integration/memory/vite.config.mts",
"dependencies": [
"./internals/common:build",
"./internals/http-server:build",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ import { JSHandle, Page } from 'puppeteer';
import { describe, it, expect, } from 'vitest';
import Upscaler, { ModelDefinition } from 'upscaler';
import * as tf from '@tensorflow/tfjs';
import path from 'path';
import { ClientsideTestRunner } from '@internals/test-runner/clientside';

const EXPECTED_LAYER_MODELS = 2; // I don't know why, but we start with layer model references in memory.
const EXPECTED_UPSCALERS = 0;

const ROOT_BUNDLER_OUTPUT_DIR = process.env.ROOT_BUNDLER_OUTPUT_DIR;
if (typeof ROOT_BUNDLER_OUTPUT_DIR !== 'string') {
throw new Error('ROOT_BUNDLER_OUTPUT_DIR not defined in env');
const ESBUILD_DIST_FOLDER = process.env.ESBUILD_DIST_FOLDER;
if (typeof ESBUILD_DIST_FOLDER !== 'string') {
throw new Error('ESBUILD_DIST_FOLDER not defined in env');
}
const ESBUILD_DIST_FOLDER = path.resolve(ROOT_BUNDLER_OUTPUT_DIR, 'esbuild/dist')

// https://puppeteer.github.io/puppeteer/docs/10.0.0/puppeteer.page.queryobjects/#example
const countObjects = async (page: Page, prototype: JSHandle): Promise<number> => {
Expand Down

0 comments on commit 6f33f91

Please sign in to comment.