0
Fork 0
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:
Nate Moore 2022-02-18 15:40:03 -06:00 committed by GitHub
parent 3c2eee5732
commit 37d4dd8d57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 12 deletions

View file

@ -202,14 +202,9 @@ jobs:
env:
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.
- name: Test (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: node ./scripts/smoke/index.js
- name: Test
run: yarn test:smoke
- name: Memory Leak Test
run: |

View file

@ -14,6 +14,7 @@
"test": "turbo run test --scope=astro",
"test:match": "cd packages/astro && yarn run test:match",
"test:templates": "turbo run test --scope=create-astro",
"test:smoke": "node scripts/smoke/index.js",
"benchmark": "turbo run benchmark --scope=astro",
"lint": "eslint \"packages/**/*.ts\"",
"format": "prettier -w ."

View file

@ -26,10 +26,10 @@ const exampleDir = new URL('examples/', rootDir);
const astroDir = new URL('packages/astro/', rootDir);
/** 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. */
const wwwGithubConfig = { org: 'withastro', name: 'astro.build', branch: 'main' };
// const wwwGithubConfig = { org: 'withastro', name: 'astro.build', branch: 'main' };
/* Application
/* -------------------------------------------------------------------------- */
@ -41,17 +41,17 @@ async function run() {
const directories = await getChildDirectories(exampleDir);
// 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');
await execa('yarn', [], { cwd: fileURLToPath(rootDir), stdout: 'inherit', stderr: 'inherit' });
await execa('yarn', [], { cwd: fileURLToPath(rootDir), stdio: 'inherit' });
for (const directory of directories) {
console.log('🤖', 'Testing', directory.pathname.split('/').at(-1));
try {
await execa('yarn', ['build'], { cwd: fileURLToPath(directory), stdout: 'inherit', stderr: 'inherit' });
await execa('yarn', ['run', 'build'], { cwd: fileURLToPath(directory), stdio: 'inherit' });
} catch (err) {
console.log(err);