Skip to content

Commit

Permalink
DROP: debug test
Browse files Browse the repository at this point in the history
  • Loading branch information
vio committed Sep 14, 2023
1 parent 4155c37 commit 206c75e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 98 deletions.
97 changes: 0 additions & 97 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,6 @@ jobs:
matrix:
os: [windows-latest, ubuntu-latest]
node: [20, 18, 16, 14]
exclude:
- os: windows-latest
node: 20
- os: windows-latest
node: 18
- os: windows-latest
node: 16
runs-on: ${{ matrix.os }}
name: CLI ${{ matrix.os }} nodejs ${{ matrix.node }}
steps:
Expand Down Expand Up @@ -215,102 +208,12 @@ jobs:
run: npm run test:package
working-directory: packages/cli

test-package-webpack-plugin:
needs:
- build
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
node: [20, 18, 16, 14]
webpack: ['webpack4', 'webpack5']
exclude:
- webpack: 'webpack4'
node: 18
- webpack: 'webpack4'
node: 20
- os: windows-latest
node: 20
- os: windows-latest
node: 18
- os: windows-latest
node: 16
runs-on: ${{ matrix.os }}
name: ${{ matrix.webpack }} plugin ${{ matrix.os }} nodejs ${{ matrix.node }}
steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3.8.1
with:
node-version: ${{ matrix.node }}

- name: Download build files
uses: actions/download-artifact@v3
with:
name: build-artifacts

- name: Download local registry files
uses: actions/download-artifact@v3
with:
name: local-registry

- name: Install dependencies
run: npm install -g verdaccio

- name: Run local npm registry
run: ./scripts/local-registry.sh &

- name: Test package
run: npm run test:package -- -t ${{ matrix.webpack }}
working-directory: packages/webpack-plugin

test-package-rollup-plugin:
needs:
- build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [16]
runs-on: ${{ matrix.os }}
name: rollup plugin ${{ matrix.os }} nodejs ${{ matrix.node }}
steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3.8.1
with:
node-version: ${{ matrix.node }}

- name: Download build files
uses: actions/download-artifact@v3
with:
name: build-artifacts

- name: Download local registry files
uses: actions/download-artifact@v3
with:
name: local-registry

- name: Install dependencies
run: npm install -g verdaccio

- name: Run local npm registry
run: ./scripts/local-registry.sh &

- name: Test package
run: npm run test:package
working-directory: packages/rollup-plugin

tests:
needs:
- lint
- test-unit
- test-e2e
- test-package-cli
- test-package-webpack-plugin
- test-package-rollup-plugin
runs-on: ubuntu-latest
steps:
- run: echo "Tests done."
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ export default async function run(options: RunOptions): Promise<void> {
// Generate relative path relative to process.cwd()
const baselinePath = getBaselineRelativePath(process.cwd(), '', baselineAbsolutePath);

console.log({
dirname: __dirname,
cwd: process.cwd(),
baselineAbsolutePath,
baselinePath,
});

const tasks = new Listr([
{
title: 'Read Webpack stats files',
Expand Down
9 changes: 8 additions & 1 deletion packages/cli/test/package/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('CLI', () => {
expect(stdout).toContain('[SUCCESS] Save reports');
});

test('should generate report with custom relative baseline filepath', async () => {
test.only('should generate report with custom relative baseline filepath', async () => {
// prime relative custom baseline
const baselineCustomRelativeDirectory = path.join('dist', baselineCustomDirectory);
const baselineCustomRelativeFilepath = path.join('dist', baselineCustomFilepath);
Expand All @@ -131,10 +131,17 @@ describe('CLI', () => {
baselineCustomRelativeFilepath,
);

console.log({
baselineCustomRelativeDirectory,
baselineCustomRelativeFilepath,
});

const { stdout } = await exec(
`npx bundle-stats --compare --baseline --baseline-filepath ${baselineCustomFilepath} ../../__fixtures__/webpack-stats.current.json`,
);

console.log(stdout);

const htmlReport = await fs.readFile('dist/bundle-stats.html', 'utf8');
expect(htmlReport).toContain('Bundle Size — 2MiB (-3.11%). - BundleStats');

Expand Down

0 comments on commit 206c75e

Please sign in to comment.