From 5b4ab9c0200050fca7b15b2b087293b909f67dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Ign=C3=A1cio=20Fontoura=20Solla?= Date: Thu, 30 Jul 2026 13:25:49 -0300 Subject: [PATCH] =?UTF-8?q?fix(ci):=20unblock=20PR=20checks=20=E2=80=94=20?= =?UTF-8?q?checkout=20in=20migration-lock,=20seed-proof=20leadership=20spe?= =?UTF-8?q?c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit migration-lock ran `gh pr list --json files` without actions/checkout, so every PR failed the job in 3s with "not a git repository". The leadership portfolio spec asserted the exact global hit set with fixed names, which the minimal seed (Seed Liderança Um/Dois) collides with via word-start 'Lider'; switch to the unique-token pattern already used by the demands spec. --- .github/workflows/ci-pr.yml | 3 +++ tests/int/homeSearchLeaderships.int.spec.ts | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 98c730f0..2dcc477a 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -88,6 +88,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: + # gh expands --json files via git, so it needs the repo checked out. + - uses: actions/checkout@v4 + - name: Count open PRs touching schema files env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests/int/homeSearchLeaderships.int.spec.ts b/tests/int/homeSearchLeaderships.int.spec.ts index 49fbe6be..0a80c878 100644 --- a/tests/int/homeSearchLeaderships.int.spec.ts +++ b/tests/int/homeSearchLeaderships.int.spec.ts @@ -69,8 +69,11 @@ describe('searchHomeLeaderships (B49)', () => { const other = await fixtures.getMunicipality('feira-de-santana') await fixtures.assignMunicipalityAdvisors(administered.id, [advisor.id]) - const inScope = await fixtures.createContact({ name: 'Lider Cairu' }) - const outOfScope = await fixtures.createContact({ name: 'Lider Feira' }) + // Unique token per run: the minimal seed ships leaderships whose contact + // names collide with fixed queries like 'Lider' (word-start match). + const scopeToken = fixtures.value('scope-lideranca') + const inScope = await fixtures.createContact({ name: `${scopeToken} Cairu` }) + const outOfScope = await fixtures.createContact({ name: `${scopeToken} Feira` }) const scopedLeadership = await fixtures.createLeadership({ contact: inScope.id, municipalities: [administered.id], @@ -80,10 +83,10 @@ describe('searchHomeLeaderships (B49)', () => { municipalities: [other.id], }) - const advisorResult = await searchHomeLeaderships(payload, advisor, 'Lider') + const advisorResult = await searchHomeLeaderships(payload, advisor, scopeToken) expect(advisorResult.map((hit) => hit.id)).toEqual([scopedLeadership.id]) - const coordinatorResult = await searchHomeLeaderships(payload, coordinator, 'Lider') + const coordinatorResult = await searchHomeLeaderships(payload, coordinator, scopeToken) expect(coordinatorResult.map((hit) => hit.id).sort((a, b) => a - b)).toEqual( [scopedLeadership.id, otherLeadership.id].sort((a, b) => a - b), )