diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6233e9..d421baf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,15 +35,16 @@ jobs: run: pnpm turbo build - name: Check types run: pnpm turbo types:check - - name: Cache example files - id: cache-real-world-examples - uses: actions/cache@v4 - with: - path: packages/openapi-parser/tests/files - key: real-world-examples - - if: steps.cache-real-world-examples != 'true' - name: 'Prepare test environment (fetch example files)' + # - name: Cache example files + # id: cache-real-world-examples + # uses: actions/cache@v4 + # with: + # path: packages/openapi-parser/tests/files + # key: real-world-examples + - name: 'Prepare test environment (fetch example files)' run: pnpm test:prepare + - name: Debug output + run: ls -la packages/openapi-parser/tests/files - name: Run tests run: pnpm turbo test # TODO: Make repository public first diff --git a/packages/openapi-parser/tests/files.test.ts b/packages/openapi-parser/tests/files.test.ts index 59a706e..5fd2a02 100644 --- a/packages/openapi-parser/tests/files.test.ts +++ b/packages/openapi-parser/tests/files.test.ts @@ -15,6 +15,8 @@ const files = ( await glob('./packages/openapi-parser/tests/files/*.yaml') ).filter((file) => !invalidFiles.includes(file)) +console.log('files', files) + /** * This test suite parses a large number of real-world OpenAPI files */ diff --git a/scripts/fetch-files.ts b/scripts/fetch-files.ts index 3989d14..c3677ec 100644 --- a/scripts/fetch-files.ts +++ b/scripts/fetch-files.ts @@ -17,23 +17,21 @@ console.log() console.log('Start downloading …') apis.forEach((api) => { - console.log(`Fetch ${api.swaggerYamlUrl}…`) + console.log(`Fetch ${api.swaggerYamlUrl}`) fetch(api.swaggerYamlUrl) .then(async (response) => { const content = await response.text() const filename = `${slugger.slug(api.name)}.yaml` - - fs.writeFile( - `./packages/openapi-parser/tests/files/${filename}`, - content, - (err) => { - if (err) { - throw err - } - }, - ) + const file = `./packages/openapi-parser/tests/files/${filename}` + + console.log('Write', file) + fs.writeFile(file, content, (err) => { + if (err) { + throw err + } + }) }) .catch((err) => { console.error(`[ERROR] Failed to fetch ${api.swaggerYamlUrl}`, err)