Skip to content

Commit

Permalink
ci: fix c8 results (#116)
Browse files Browse the repository at this point in the history
* ci: debug c8 results

* ci: configure the codecov.yml

* ci: configure the codecov.yml

* ci: configure the codecov.yml

* ci: configure the codecov.yml

* ci: configure the codecov.yml

* ci: configure the .codecov.yml

* ci: debug codecov

* ci: configure the codecov.yml

* ci: configure the codecov.yml

* ci: configure the codecov.yml

* ci: configure the codecov.yml

* ci: configure the codecov.yml

* ci: adapt tests to Codecov

* ci: set Codecov target

* ci: ensure all files to coverage report
  • Loading branch information
wellwelwel authored Mar 16, 2024
1 parent b44f965 commit b5f4539
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .c8rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"include": ["ci/src/**"],
"all": true,
"exclude": ["ci/src/@types/**"]
}
1 change: 0 additions & 1 deletion .github/workflows/ci-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ jobs:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: wellwelwel/poku
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
codecov:
disable_default_path_fixes: true

fixes:
- 'ci/::/'

coverage:
status:
project:
default:
target: 75%
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"test": "tsx ./test/run.test.ts",
"pretest:c8": "npm run build",
"test:c8": "c8 --include 'src/**' --exclude 'src/@types/**' --reporter=text --reporter=lcov npx poku --parallel --debug test/unit,test/integration,test/e2e",
"test:c8": "c8 --reporter=text --reporter=lcov npm run test:e2e",
"test:e2e": "npx poku --parallel ci/test/unit,ci/test/integration,ci/test/e2e",
"test:ci": "tsx ./test/ci.test.ts",
"test:node": "FILTER='node-' npm run test:ci",
"test:deno": "FILTER='deno-' npm run test:ci",
Expand Down
1 change: 1 addition & 0 deletions test/docker/deno/1.30.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WORKDIR /usr/app
COPY ./src ./src
COPY ./test ./test
COPY ./tools ./tools
COPY ./fixtures ./fixtures

RUN deno run --allow-read --allow-write --allow-env --allow-run tools/compatibility/deno.ts

Expand Down
1 change: 1 addition & 0 deletions test/docker/deno/latest.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WORKDIR /usr/app
COPY ./src ./src
COPY ./test ./test
COPY ./tools ./tools
COPY ./fixtures ./fixtures

RUN deno run --allow-read --allow-write --allow-env --allow-run tools/compatibility/deno.ts

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/node/background-process.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test(async () => {

const server = await startService(`server-a.${ext}`, {
startAfter: 'ready',
cwd: 'test/fixtures/server',
cwd: 'fixtures/server',
timeout: 10000,
});

Expand All @@ -37,7 +37,7 @@ test(async () => {

const server = await startScript(`start:b:${ext}`, {
startAfter: 'ready',
cwd: 'test/fixtures/server',
cwd: 'fixtures/server',
timeout: 10000,
});

Expand Down
6 changes: 4 additions & 2 deletions test/e2e/node/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ test(async () => {
describe('Poku Test Runner: CLI', { background: false, icon: '🐷' });

const output = await executeCLI([
`./src/bin/index.${ext}`,
`test/integration/code.test.${ext}`,
ext === 'ts' ? `src/bin/index.${ext}` : `ci/src/bin/index.${ext}`,
ext === 'ts'
? `test/integration/code.test.${ext}`
: `ci/test/integration/code.test.${ext}`,
]);

assert(/PASS › 1/.test(JSON.stringify(output)), 'CLI needs to pass 1');
Expand Down
16 changes: 8 additions & 8 deletions test/integration/code.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { poku, assert, describe, test } from '../../src/index.js';
describe('Poku Runner Suite', { background: false, icon: '🐷' });

test(async () => {
const code = await poku(['./test/fixtures/success', 'test/fixtures/fail'], {
const code = await poku(['./fixtures/success', 'fixtures/fail'], {
noExit: true,
quiet: true,
});
Expand All @@ -12,7 +12,7 @@ test(async () => {
});

test(async () => {
const code = await poku('./test/fixtures/fail', {
const code = await poku('./fixtures/fail', {
noExit: true,
quiet: true,
});
Expand All @@ -21,7 +21,7 @@ test(async () => {
});

test(async () => {
const code = await poku('./test/fixtures/success', {
const code = await poku('./fixtures/success', {
noExit: true,
quiet: true,
});
Expand All @@ -30,7 +30,7 @@ test(async () => {
});

test(async () => {
const code = await poku(['./test/fixtures/success'], {
const code = await poku(['./fixtures/success'], {
noExit: true,
quiet: true,
});
Expand All @@ -39,7 +39,7 @@ test(async () => {
});

test(async () => {
const code = await poku(['./test/fixtures/success', 'test/fixtures/fail'], {
const code = await poku(['./fixtures/success', 'fixtures/fail'], {
noExit: true,
filter: /success/,
quiet: true,
Expand All @@ -49,7 +49,7 @@ test(async () => {
});

test(async () => {
const code = await poku(['./test/fixtures/success', 'test/fixtures/fail'], {
const code = await poku(['./fixtures/success', 'fixtures/fail'], {
noExit: true,
filter: /fail/,
quiet: true,
Expand All @@ -59,7 +59,7 @@ test(async () => {
});

test(async () => {
const code = await poku(['test/fixtures/fail'], {
const code = await poku(['fixtures/fail'], {
noExit: true,
filter: /success/,
quiet: true,
Expand All @@ -69,7 +69,7 @@ test(async () => {
});

test(async () => {
const code = await poku(['./test/fixtures/success', 'test/fixtures/fail'], {
const code = await poku(['./fixtures/success', 'fixtures/fail'], {
noExit: true,
filter: /\.(m)?(j|t)?s$/,
quiet: true,
Expand Down
4 changes: 2 additions & 2 deletions test/unit/run-test-file.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ const ext = getRuntime() === 'deno' ? 'ts' : isProduction ? 'js' : 'ts';
describe('Service: runTestFile', { background: false, icon: '🔬' });

test(async () => {
const code = await runTestFile(`./test/fixtures/fail/exit.test.${ext}`, {
const code = await runTestFile(`./fixtures/fail/exit.test.${ext}`, {
quiet: true,
});

assert.deepStrictEqual(code, false, 'Failure test file case');
});

test(async () => {
const code = await runTestFile(`./test/fixtures/success/exit.test.${ext}`, {
const code = await runTestFile(`./fixtures/success/exit.test.${ext}`, {
quiet: true,
});

Expand Down
4 changes: 2 additions & 2 deletions test/unit/run-tests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { runTests } from '../../src/services/run-tests.js';
describe('Service: runTests', { background: false, icon: '🔬' });

test(async () => {
const code = await runTests('./test/fixtures/fail', {
const code = await runTests('./fixtures/fail', {
noExit: true,
quiet: true,
});
Expand All @@ -13,7 +13,7 @@ test(async () => {
});

test(async () => {
const code = await runTests('./test/fixtures/success', {
const code = await runTests('./fixtures/success', {
noExit: true,
quiet: true,
});
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.json",
"include": ["test", "src"],
"include": ["test", "src", "fixtures"],
"exclude": ["tools"],
"compilerOptions": {
"outDir": "ci",
Expand Down

0 comments on commit b5f4539

Please sign in to comment.