Skip to content

fix: update acceptance tests for staging#1208

Open
itslenny wants to merge 2 commits into
masterfrom
lenny/update-acceptance-tests-for-staging
Open

fix: update acceptance tests for staging#1208
itslenny wants to merge 2 commits into
masterfrom
lenny/update-acceptance-tests-for-staging

Conversation

@itslenny

@itslenny itslenny commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Acceptance tests cannot run against staging environment

What is the new behavior?

Adjust acceptance tests so they can be run against staging

Add CDN Edge tests to test Smart CDN and cache purge behavior end to end

@coveralls

coveralls commented Jul 6, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29267338856

Coverage increased (+0.005%) to 79.381%

Details

  • Coverage increased (+0.005%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 12635
Covered Lines: 10475
Line Coverage: 82.9%
Relevant Branches: 7327
Covered Branches: 5371
Branch Coverage: 73.3%
Branches in Coverage %: Yes
Coverage Strength: 424.02 hits per line

💛 - Coveralls

@itslenny itslenny force-pushed the lenny/update-acceptance-tests-for-staging branch 3 times, most recently from ad50cad to 2525db3 Compare July 11, 2026 20:37
@itslenny itslenny force-pushed the lenny/update-acceptance-tests-for-staging branch 3 times, most recently from e354c44 to 72a5211 Compare July 12, 2026 16:15
@itslenny itslenny marked this pull request as ready for review July 12, 2026 16:59
@itslenny itslenny requested a review from a team as a code owner July 12, 2026 16:59
@itslenny itslenny force-pushed the lenny/update-acceptance-tests-for-staging branch 2 times, most recently from a3588fb to af97392 Compare July 12, 2026 18:49
await cleanupRestResources(bucketName, [], client)
})

it('purges an object cache entry', async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we can use it.skipIf(!isCdnEdge) helper so that we can remove the ifs isCdnEdge

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have to add separate tests for that to work. These tests hit the purge endpoints in both local and remote mode. Only in remote mode can we test if the purge actually worked. So, rather than having fully separate remote/local tests I am just conditionally doing the check on remote only before/after the purge.

Comment thread acceptance/specs/tus.test.ts
@itslenny itslenny force-pushed the lenny/update-acceptance-tests-for-staging branch from af97392 to 9001287 Compare July 13, 2026 16:39
@itslenny itslenny requested a review from fenos July 13, 2026 16:43
Comment thread acceptance/README.md

```bash
mkdir -p data
STORAGE_BACKEND=file ACCEPTANCE_ENABLE_RENDER=true npm run acceptance -- --profile full acceptance/specs/cdn-render.test.ts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
STORAGE_BACKEND=file ACCEPTANCE_ENABLE_RENDER=true npm run acceptance -- --profile full acceptance/specs/render.test.ts

Comment on lines +174 to +182
await client.request('GET', purgedRoute, {
expectedCacheStatus: 'MISS',
expectedStatus: 200,
})
await client.request('GET', purgedRoute, {
expectedCacheStatus: 'HIT',
expectedStatus: 200,
retries: CACHE_RETRIES,
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeated many times, this could be be a helper

await delay(SIGNED_EXPIRES_IN_S * 1000)

const expectedError = isSigned
? { statusCode: '400', error: 'InvalidJWT' }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should test not expiring token to test real cache invalidation

await delay(SIGNED_EXPIRES_IN_S * 1000)

const expectedError = isSigned
? { statusCode: '400', error: 'InvalidJWT' }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar non-expiring token should be used here as well

{
destructive: true,
profiles: ['full'],
requires: ['cdn'],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hits to render but doesn't require it


// check invalid token / access denied
if (isSigned) {
// const { route } = items[0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// const { route } = items[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants