mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Improve smoke tests (#2617)
* chore(ci): improve smoke tests * chore: skip www test
This commit is contained in:
parent
3c2eee5732
commit
37d4dd8d57
3 changed files with 8 additions and 12 deletions
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
|
@ -202,14 +202,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
- name: Test
|
|
||||||
if: ${{ matrix.os != 'windows-latest' }}
|
|
||||||
run: yarn run build:examples --concurrency=1
|
|
||||||
|
|
||||||
# Turbo seems to fail on Windows, so run a custom script directly.
|
# Turbo seems to fail on Windows, so run a custom script directly.
|
||||||
- name: Test (Windows)
|
- name: Test
|
||||||
if: ${{ matrix.os == 'windows-latest' }}
|
run: yarn test:smoke
|
||||||
run: node ./scripts/smoke/index.js
|
|
||||||
|
|
||||||
- name: Memory Leak Test
|
- name: Memory Leak Test
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"test": "turbo run test --scope=astro",
|
"test": "turbo run test --scope=astro",
|
||||||
"test:match": "cd packages/astro && yarn run test:match",
|
"test:match": "cd packages/astro && yarn run test:match",
|
||||||
"test:templates": "turbo run test --scope=create-astro",
|
"test:templates": "turbo run test --scope=create-astro",
|
||||||
|
"test:smoke": "node scripts/smoke/index.js",
|
||||||
"benchmark": "turbo run benchmark --scope=astro",
|
"benchmark": "turbo run benchmark --scope=astro",
|
||||||
"lint": "eslint \"packages/**/*.ts\"",
|
"lint": "eslint \"packages/**/*.ts\"",
|
||||||
"format": "prettier -w ."
|
"format": "prettier -w ."
|
||||||
|
|
|
@ -26,10 +26,10 @@ const exampleDir = new URL('examples/', rootDir);
|
||||||
const astroDir = new URL('packages/astro/', rootDir);
|
const astroDir = new URL('packages/astro/', rootDir);
|
||||||
|
|
||||||
/** GitHub configuration for the external "docs" Astro project. */
|
/** GitHub configuration for the external "docs" Astro project. */
|
||||||
const docGithubConfig = { org: 'withastro', name: 'docs', branch: 'main' };
|
// const docGithubConfig = { org: 'withastro', name: 'docs', branch: 'main' };
|
||||||
|
|
||||||
/** GitHub configuration for the external "astro.build" Astro project. */
|
/** GitHub configuration for the external "astro.build" Astro project. */
|
||||||
const wwwGithubConfig = { org: 'withastro', name: 'astro.build', branch: 'main' };
|
// const wwwGithubConfig = { org: 'withastro', name: 'astro.build', branch: 'main' };
|
||||||
|
|
||||||
/* Application
|
/* Application
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
@ -41,17 +41,17 @@ async function run() {
|
||||||
const directories = await getChildDirectories(exampleDir);
|
const directories = await getChildDirectories(exampleDir);
|
||||||
|
|
||||||
// TODO Skipped the docs-main test since it is failing at the moment.
|
// TODO Skipped the docs-main test since it is failing at the moment.
|
||||||
directories.push(/*await downloadGithubZip(docGithubConfig), */ await downloadGithubZip(wwwGithubConfig));
|
// TODO Skipped the www test since it is failing at the moment.
|
||||||
|
|
||||||
console.log('🤖', 'Preparing', 'yarn');
|
console.log('🤖', 'Preparing', 'yarn');
|
||||||
|
|
||||||
await execa('yarn', [], { cwd: fileURLToPath(rootDir), stdout: 'inherit', stderr: 'inherit' });
|
await execa('yarn', [], { cwd: fileURLToPath(rootDir), stdio: 'inherit' });
|
||||||
|
|
||||||
for (const directory of directories) {
|
for (const directory of directories) {
|
||||||
console.log('🤖', 'Testing', directory.pathname.split('/').at(-1));
|
console.log('🤖', 'Testing', directory.pathname.split('/').at(-1));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await execa('yarn', ['build'], { cwd: fileURLToPath(directory), stdout: 'inherit', stderr: 'inherit' });
|
await execa('yarn', ['run', 'build'], { cwd: fileURLToPath(directory), stdio: 'inherit' });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue