fix: update acceptance tests for staging#1208
Conversation
Coverage Report for CI Build 29267338856Coverage increased (+0.005%) to 79.381%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
ad50cad to
2525db3
Compare
e354c44 to
72a5211
Compare
a3588fb to
af97392
Compare
| await cleanupRestResources(bucketName, [], client) | ||
| }) | ||
|
|
||
| it('purges an object cache entry', async () => { |
There was a problem hiding this comment.
i think we can use it.skipIf(!isCdnEdge) helper so that we can remove the ifs isCdnEdge
There was a problem hiding this comment.
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.
af97392 to
9001287
Compare
|
|
||
| ```bash | ||
| mkdir -p data | ||
| STORAGE_BACKEND=file ACCEPTANCE_ENABLE_RENDER=true npm run acceptance -- --profile full acceptance/specs/cdn-render.test.ts |
There was a problem hiding this comment.
| STORAGE_BACKEND=file ACCEPTANCE_ENABLE_RENDER=true npm run acceptance -- --profile full acceptance/specs/render.test.ts |
| await client.request('GET', purgedRoute, { | ||
| expectedCacheStatus: 'MISS', | ||
| expectedStatus: 200, | ||
| }) | ||
| await client.request('GET', purgedRoute, { | ||
| expectedCacheStatus: 'HIT', | ||
| expectedStatus: 200, | ||
| retries: CACHE_RETRIES, | ||
| }) |
There was a problem hiding this comment.
repeated many times, this could be be a helper
| await delay(SIGNED_EXPIRES_IN_S * 1000) | ||
|
|
||
| const expectedError = isSigned | ||
| ? { statusCode: '400', error: 'InvalidJWT' } |
There was a problem hiding this comment.
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' } |
There was a problem hiding this comment.
similar non-expiring token should be used here as well
| { | ||
| destructive: true, | ||
| profiles: ['full'], | ||
| requires: ['cdn'], |
There was a problem hiding this comment.
hits to render but doesn't require it
|
|
||
| // check invalid token / access denied | ||
| if (isSigned) { | ||
| // const { route } = items[0] |
There was a problem hiding this comment.
| // const { route } = items[0] |
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