Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test_harmony #2550

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .github/actions/get_test_infos/discover_test_dirs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@ import { join } from 'path';

// Recursively find directories and check for package.json with a test script
export async function discoverTestDirs(dirToSearch: string): Promise<string[]> {
// Check the root directory first
const hasTestScript = await checkForTestScript(
join(dirToSearch, 'package.json')
);
if (hasTestScript === true) {
return [dirToSearch];
}

// If no test script found, check subdirectories
const files = await readdir(dirToSearch, { withFileTypes: true });

return files.reduce(
async (accPromise, file) => {
const acc = await accPromise;

const fullPath = join(dirToSearch, file.name);

if (file.isDirectory() && !fullPath.includes('node_modules')) {
// Check for package.json and if it contains a test script
const packageJsonPath = join(fullPath, 'package.json');
const hasTestScript = await checkForTestScript(packageJsonPath);

// Recurse into subdirectory
return [
...acc,
...(hasTestScript ? [fullPath] : []),
...(await discoverTestDirs(fullPath))
];
return [...acc, ...(await discoverTestDirs(fullPath))];
}

return acc;
Expand Down
52 changes: 4 additions & 48 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,56 +92,12 @@ jobs:
matrix:
test_group:
- {
name: 'Stable Demo',
directories: './examples/stable/demo'
name: 'Fetch IC',
directories: './examples/experimental/test/end_to_end/http_server/fetch_ic'
}
- {
name: 'Stable Demo (Experimental)',
directories: './examples/stable/demo',
run-experimental: true
}
- {
name: 'Experimental Demo',
directories: './examples/experimental/demo'
}
- {
name: 'Stable E2E CRPC',
directories: './examples/stable/test/end_to_end/candid_rpc'
}
- {
name: 'Stable E2E CRPC (Experimental)',
directories: './examples/stable/test/end_to_end/candid_rpc',
run-experimental: true
}
- {
name: 'Experimental E2E CRPC',
directories: './examples/experimental/test/end_to_end/candid_rpc'
}
- {
name: 'Experimental E2E HTTP Server',
directories: './examples/experimental/test/end_to_end/http_server'
}
- {
name: 'Stable Property CRPC',
directories: './examples/stable/test/property/candid_rpc'
}
- {
name: 'Stable Property CRPC (Experimental)',
directories: './examples/stable/test/property/candid_rpc',
run-experimental: true
}
- {
name: 'Experimental Property CRPC',
directories: './examples/experimental/test/property/candid_rpc'
}
- {
name: 'Stable Property IC API',
directories: './examples/stable/test/property/ic_api'
}
- {
name: 'Stable Property IC API (Experimental)',
directories: './examples/stable/test/property/ic_api',
run-experimental: true
name: 'Internet Identity',
directories: './examples/experimental/test/end_to_end/http_server/internet_identity'
}
uses: ./.github/workflows/run_test.yml
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function getTests(canisterName: string): Test {
browser = await puppeteer.launch({
headless:
process.env.GITHUB_RUN_ID === undefined ? false : true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
args: ['--no-sandbox']
});
page = await browser.newPage();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function getTests(canisterName: string): Test {
return () => {
it('supports internet identity authentication', async () => {
const browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox']
args: ['--no-sandbox']
});
const page = await browser.newPage();

Expand Down
Loading