-
-
Notifications
You must be signed in to change notification settings - Fork 357
test: e2e replay #3993
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
Closed
Closed
test: e2e replay #3993
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
fe7ab45
wip: extract e2e test script from yaml
vaind a393435
update e2e test script
vaind 5c13f0d
move more stuff to e2e.js
vaind a477d6e
script args
vaind fc61db5
more stuff moved to e2e.js
vaind 857e6a8
run tests from e2e script
vaind 53e825f
remove e2e build from ci
vaind dd8abf5
fix ruby/setup-ruby
vaind b0a2ca2
update actions
vaind 273a376
more script fixes
vaind 7b7a0c2
fixup script on CI
vaind e368e4a
cleanup
vaind fd4c50a
fix CI
vaind b6601a3
fix CI
vaind 655300d
linter issues
vaind 2dc8ebc
Merge branch 'main' into test/e2e-refactor
vaind 3f65502
post-merge script update
vaind 6e94861
Update scripts/e2e.mjs
vaind 612813d
Update scripts/e2e.mjs
vaind 85e6afb
Update scripts/e2e.mjs
vaind efd1f9a
Update scripts/e2e.mjs
vaind 883f9fb
cleanup
vaind 5701c7c
move webdriveragent build to test
vaind 030049d
cache webdriveragent build
vaind 1739957
Merge branch 'main' into test/e2e-refactor
vaind d0b1f42
use bundler
vaind 8becfea
Update e2e.yml
vaind b26695b
fix e2e test run
vaind 009864d
try to fix ci
vaind d2cd560
Update e2e.yml
vaind 0442bfa
fixes
vaind 35b1c9e
try to remove node module removal
vaind 883b36a
fix caching
vaind 80b5fa4
Revert "try to remove node module removal"
vaind 991927e
fix e2e.yml cache config
vaind a31ca9a
fix appium invocation
vaind 459e842
handle child processes gracefully
vaind 6c1bb2c
try to fix android test hangs
vaind 11c1692
try to fix ci
vaind d742a85
tmp: debug session
vaind f1140fa
tmp killall
vaind 082406e
fix android ci
vaind 5ddfeb9
roll back unintended changes
vaind 92fa628
fix hanging CI
vaind f554613
ensure node_modules from root are not resolved during e2e test app build
vaind 6074dae
Merge branch 'main' into test/e2e-refactor
vaind 03a948c
Merge branch 'main' into test/e2e-refactor
vaind 3c8fac9
e2e replay test
vaind 89bb744
Merge branch 'main' into test/e2e-replay
vaind ae69622
test: replay video segments data
vaind 931c9e1
Merge branch 'main' into test/e2e-replay
vaind 37f2f8d
linter issue
vaind 9029815
Merge branch 'main' into test/e2e-replay
vaind 6dee84a
enable debug logging in e2e tests
vaind 61e5700
show emulator window to enable replay recording
vaind ed27926
no no-window doesn't work
vaind 8f4b251
Merge branch 'main' into test/e2e-replay
vaind 1863e62
try to fix android screenshots
vaind f2ef368
don't run e2e replay test on android
vaind 8bf63c7
disable session replay in tests
vaind 4ee29f2
Merge branch 'main' into test/e2e-replay
vaind 9c4de41
Merge branch 'main' into test/e2e-replay
vaind File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,68 @@ | ||
| import type { Event } from '@sentry/types'; | ||
|
|
||
| const baseUrl = 'https://sentry.io/api/0/projects/sentry-sdks/sentry-react-native'; | ||
|
|
||
| interface ApiEvent extends Event { | ||
| /** | ||
| * The event returned from the API uses eventID | ||
| */ | ||
| eventID: string; | ||
| } | ||
|
|
||
| const RETRY_COUNT = 600; | ||
| const RETRY_INTERVAL = 1000; | ||
|
|
||
| const fetchFromSentry = async (url: string): Promise<Response> => { | ||
| expect(process.env.SENTRY_AUTH_TOKEN).toBeDefined(); | ||
| expect(process.env.SENTRY_AUTH_TOKEN?.length).toBeGreaterThan(0); | ||
|
|
||
| const request = () => | ||
| fetch(url, { | ||
| headers: { | ||
| Authorization: `Bearer ${process.env.SENTRY_AUTH_TOKEN}`, | ||
| 'Content-Type': 'application/json', | ||
| }, | ||
| method: 'GET', | ||
| }); | ||
|
|
||
| let retries = 0; | ||
| const retrier = (response: Response): Promise<Response> => | ||
| new Promise((resolve, reject) => { | ||
| if (response.status === 200) { | ||
| resolve(response); | ||
| } else if (response.status === 403) { | ||
| reject(new Error(`Could not fetch ${url}: ${response.statusText}`)); | ||
| } else if (retries < RETRY_COUNT) { | ||
| setTimeout(() => { | ||
| retries++; | ||
| // eslint-disable-next-line no-console | ||
| console.log( | ||
| `API request (${url}) failed with: ${response.statusText}. Retrying. Retry number: ${retries}/${RETRY_COUNT}`, | ||
| ); | ||
| resolve(request().then(retrier)); | ||
| }, RETRY_INTERVAL); | ||
| } else { | ||
| reject(new Error(`Could not fetch ${url} within retry limit.`)); | ||
| } | ||
| }); | ||
|
|
||
| return request().then(retrier); | ||
| }; | ||
|
|
||
| const fetchEvent = async (eventId: string): Promise<ApiEvent> => { | ||
| const response = await fetchFromSentry(`${baseUrl}/events/${eventId}/`); | ||
| const json = await response.json(); | ||
| return json as ApiEvent; | ||
| }; | ||
|
|
||
| const fetchReplay = async (replayId: string): Promise<any> => { | ||
| const response = await fetchFromSentry(`${baseUrl}/replays/${replayId}/`); | ||
| return response.json(); | ||
| }; | ||
|
|
||
| const fetchReplaySegmentVideo = async (replayId: string, segment: number): Promise<Blob> => { | ||
| const response = await fetchFromSentry(`${baseUrl}/replays/${replayId}/videos/${segment}/`); | ||
| return response.blob(); | ||
| }; | ||
|
|
||
| export { fetchEvent, fetchReplay, fetchReplaySegmentVideo }; |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.