From 1ad6a249ca1efa27460c2972e5c53a3c41d78708 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..c219f0634 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'; @@ -120,7 +119,7 @@ describe('GET /api/v1/contents/[username]/[slug]/thumbnail', () => { expect(Buffer.compare(benchmarkFile, responseBody)).toEqual(0); // has the same bytes }); - test('"root" content with long "title", long "username" and 0 "children"', async () => { + test.only('"root" content with long "title", long "username" and 0 "children"', async () => { const defaultUser = await orchestrator.createUser({ username: 'ThisUsernameHas30Characterssss', }); @@ -145,6 +144,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('.'),