-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent store data leaking across requests (#434)
* poc of nested cache data * better fake await logic * pagination type checks * pagination handlers pull from current values * fixed session retrieval * subscribe comes first * generate req_id without load * only pagination fails * first pass at drying req_id logic * share session store utilities between fetch and subscribe * fix offset pagination fetch * better cleanup * cleanup variable name * more pageinfo ssr fixes * remove errant log * cleanup pageInfos * paginated fragment pageInfo * remove unused adapter method * better protection against fragmentStore.update * add changeset * fix bug when blocked csf and pending load overlap * use sessionStore utilities when computing offsets * bump worker count when running tests * update mutation store ; increase worker number * 30 workers doesn't seem reliable on github actions * cleanup * cleanup comment * even fewer workers? * more use of session store utils * simplify the api for session stores * fixed build errors * pagination handlers now use fetch * avoid adding pageInfos to store fields * tweak expect response * remove unused imports * make linter "happy" * report tests with replay * dont use replay action * add step to upload * fix replay test run id * cache playwright browsers * pass record replay api key to upload step * add tests:replay script * try different upload replay action * different yarn cmd to install deps from cache * use setup-node@v3 * checkout before setup * more jobs * tweak workflow defn * add install deps before integration linter * add yarn cache to test job * check before instal... again * integration linter needs packages built * integration check needs a generated runtime * have to build sveltekit too? * use 10 workers for integration tests * fail on purpose * use playwright action * fix project in playwright action config * always upload videos * better test id when pushing to replay * different id scheme for replay tests * fix invalid yaml * dont report to replay * add workers back * move replay to separate config file * fix workflow yaml * fix import path in playwright replay config * replay is tricky * marshal and unmarshal are optional * add changeset * check for extra responses * better cleanup in test util * all hail the linting overlords * comment out replay video upload
- Loading branch information
1 parent
30ed45a
commit ebeb90e
Showing
27 changed files
with
1,087 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'houdini': patch | ||
--- | ||
|
||
prevent store information from leaking across requests boundaries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'houdini': patch | ||
--- | ||
|
||
updated type definition for config file to allow for missing marshal/unmarshal functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,13 +29,7 @@ jobs: | |
node-version: 16.14.2 | ||
cache: 'yarn' | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Install Dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn install | ||
env: | ||
YARN_ENABLE_IMMUTABLE_INSTALLS: false | ||
|
@@ -48,16 +42,17 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16.14.2 | ||
|
||
- name: Checkout source | ||
uses: actions/checkout@master | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'yarn' | ||
node-version: 16.14.2 | ||
|
||
- name: Install Dependencies | ||
run: yarn install | ||
env: | ||
|
@@ -74,40 +69,82 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'yarn' | ||
node-version: 16.14.2 | ||
|
||
- name: Checkout source | ||
uses: actions/checkout@master | ||
- name: Cache playwright binaries | ||
uses: actions/cache@v2 | ||
id: playwright-cache | ||
with: | ||
ref: ${{ github.ref }} | ||
path: | | ||
~/.cache/ms-playwright | ||
key: cache-playwright-linux-1.21.0 | ||
|
||
- name: Install Dependencies | ||
run: yarn install | ||
- name: Install dependencies | ||
run: yarn install --immutable | ||
env: | ||
YARN_ENABLE_IMMUTABLE_INSTALLS: false | ||
|
||
- name: Build packages | ||
run: yarn build | ||
|
||
- name: Install Playwright | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
run: npx playwright install --with-deps | ||
|
||
- name: Integration Tests | ||
run: yarn tests:integration | ||
run: yarn workspace integration tests | ||
env: | ||
RECORD_REPLAY_TEST_RUN_ID: ${{ env.GITHUB_SHA }} | ||
|
||
# - name: Upload videos | ||
# uses: replayio/[email protected] | ||
# if: ${{ always() }} | ||
# with: | ||
# api-key: ${{ secrets.RECORD_REPLAY_API_KEY }} | ||
# filter: ${{ 'function($v) { $v.metadata.test.result = "failed" and $v.status = "onDisk" }' }} | ||
|
||
integration_linter: | ||
name: Integration Linter | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'yarn' | ||
node-version: 16.14.2 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
env: | ||
YARN_ENABLE_IMMUTABLE_INSTALLS: false | ||
|
||
- name: Build packages | ||
run: yarn build | ||
|
||
- name: Generate runtime | ||
run: yarn workspace integration generate | ||
|
||
- name: Build kit assets | ||
run: yarn workspace integration build | ||
|
||
# needs to run after build & houdini generate | ||
- name: Integration lint | ||
run: yarn workspace integration lint | ||
|
||
- name: Integration check | ||
run: yarn workspace integration check | ||
|
||
- name: Upload test results | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: playwright-report | ||
path: integration/playwright-report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { PlaywrightTestConfig } from '@playwright/test'; | ||
import { devices as replayDevices } from '@replayio/playwright'; | ||
import defaultConfig from './playwright.config.ts'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
...defaultConfig, | ||
use: { ...(replayDevices['Replay Chromium'] as any) } | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
</script> | ||
|
||
<div id="result"> | ||
{$data} | ||
{JSON.stringify($data)} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { test } from '@playwright/test'; | ||
import { routes } from '../../lib/utils/routes.js'; | ||
import { | ||
clientSideNavigation, | ||
expectGraphQLResponse, | ||
expectNoGraphQLRequest, | ||
expectToBe | ||
} from '../../lib/utils/testsHelper.js'; | ||
|
||
test('Simultaneous Pending Load and CSF', async ({ page }) => { | ||
// start off on any page (/stores/network) | ||
await page.goto(routes.Stores_Network); | ||
|
||
// go to a page with both loads (should also have a clickable thing) | ||
await clientSideNavigation(page, routes.Stores_SSR_UserId_2); | ||
|
||
// we should have gotten a response from the navigation | ||
await expectGraphQLResponse(page); | ||
|
||
// make sure we get a response if we click on the button | ||
await expectGraphQLResponse(page, 'button[id="refresh-1"]'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.