-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: e2e test and fixture overhaul #159
Conversation
chore: single kubo gateway for parallel tests chore: attempting to remove beforeEach for byte-ranges chore: working on dx for e2e chore: move gateway conformance to global setup/teardown test: e2e fixtures for subdomain and path routing chore: remove unnecessary service worker wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review
if (partialText == null) throw new Error('missing response') | ||
test('can get trailing byte range from car with missing data', async ({ page }) => { | ||
const { bytes, byteSize, statusCode } = await doRangeRequest({ page, range: 'bytes=2200-', path: '/ipfs/QmYhmPjhFjYFyaoiuNzYv8WGavpSRDwdHWe5B4M5du5Rtk' }) | ||
// TODO: do we need to check the full 872 bytes...? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk if theres some block-crossing logic we want to check here, or if checking the size is sufficient, @lidel
@@ -0,0 +1,124 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was ported over from helia-http-gateway and improved slightly
const controller = await createKuboNode() | ||
await Promise.all([controller.start(), loadKuboFixtures()]) | ||
|
||
process.env.KUBO_PID = `${await controller.pid()}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought we would need this to kill the kubo instance, but it seems like playwright handles it?
import { kuboRepoDir } from './fixtures/load-kubo-fixtures.js' | ||
|
||
export default async function globalTeardown (config: Config): Promise<void> { | ||
await $`rm -rf ${kuboRepoDir}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about pushing up the kubo repo just to simplify things, but that feels bad.
Title
test: e2e test and fixture overhaul
Description
A pretty significant improvement to the way tests can be written, and use of local kubo gateway across tests. Need to debug in CI since pulling fixtures depends on
docker
being available.Summary of changes
./test-e2e/fixtures/routing-test-fixtures.ts
which automatically sets SW config./test-e2e/fixtures/load-kubo-fixtures.ts
do-range-request
test to test range requests more easily./test-e2e/locators.ts
that help with configuration setting via UI, and functions to use them:setConfigViaUiSubdomain
andsetConfigViaUi
, though they are currently unused.Notes & open questions
I will probably merge this once I get the CI passing.
Change checklist