From b1090ec2637916b4df1a7c56711e3a7567cba15b Mon Sep 17 00:00:00 2001 From: Filipe Deschamps Date: Thu, 21 Jul 2022 15:12:58 -0700 Subject: [PATCH] ci(temp): dEBUG --- .github/workflows/ci.yml | 5 +++++ .../v1/contents/[username]/[slug]/thumbnail/get.test.js | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 804a7ec37..182fe3e5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,11 @@ jobs: - run: npm ci - run: npm run dev & npx jest --runInBand + - uses: actions/upload-artifact@v3 + with: + name: thumbnail-artifact + path: thumbnail.png + - name: Stop containers if: always() run: docker-compose -f infra/docker-compose.development.yml down diff --git a/tests/integration/api/v1/contents/[username]/[slug]/thumbnail/get.test.js b/tests/integration/api/v1/contents/[username]/[slug]/thumbnail/get.test.js index f5b47b44c..8f0862e50 100644 --- a/tests/integration/api/v1/contents/[username]/[slug]/thumbnail/get.test.js +++ b/tests/integration/api/v1/contents/[username]/[slug]/thumbnail/get.test.js @@ -1,6 +1,5 @@ const { join, resolve } = require('path'); -import { readFileSync } from 'fs'; -import { setTimeout } from 'timers/promises'; +import { readFileSync, writeFileSync } from 'fs'; import fetch from 'cross-fetch'; import { version as uuidVersion } from 'uuid'; import orchestrator from 'tests/orchestrator.js'; @@ -83,7 +82,7 @@ describe('GET /api/v1/contents/[username]/[slug]/thumbnail', () => { }); jest.useFakeTimers({ - now: Date.parse('2022-01-01T00:00:00.000Z'), + now: Date.parse('2022-01-01T12:00:00.000Z'), advanceTimers: true, }); @@ -101,6 +100,8 @@ describe('GET /api/v1/contents/[username]/[slug]/thumbnail', () => { const responseBody = await response.buffer(); + writeFileSync(join(resolve('.'), 'thumbnail.png'), responseBody); + const benchmarkFile = readFileSync( join( resolve('.'),