Skip to content

Commit

Permalink
misc(ci): Update e2e tests driver (#3499)
Browse files Browse the repository at this point in the history
* Bump e2e tests to 0.73.0-rc.2

* Upgrade java version for the new react native

* Include prerelease xcode patch script

* Update default xcode version to 14.3

* Revert "Update default xcode version to 14.3"

This reverts commit ad46638.

* Bump ro rc 3

* Upgrade android to 0.73 (not all libs are compatible yet)

* Upgrade to latest rc, add safe area patch, fix ios project

* Remove start package build phase

* fix android sample

* revert sdk change

* bump ci to node 18

* bump java to v17

* Add x86_64 to bundle platforms

* keep java 11 for older builds

* Fix min ios version RN 0.73 cocoa tester

* fix codegen java version

* fix e2e build test 0.65 node version

* Keep node 18 for SDK build, bump down for app build

* Remove hermes from cocoa tester as no engine is needed

* bump to 0.73.0 stable release

* Apply suggestions from code review

Co-authored-by: LucasZF <lucas-zimerman1@hotmail.com>

* chore(internal): Use new DSN after leaked token

* chore(internal): Update e2e tests driver

* chore(rn): Update repository to RN 0.73.2

* fix fetch

* bump e2e tests runner to node 20 to fix jest SIGSEGV

* fix lint

* fix yarn lock

---------

Co-authored-by: LucasZF <lucas-zimerman1@hotmail.com>
  • Loading branch information
krystofwoldrich and lucas-zimerman committed Mar 20, 2024
1 parent 75edc50 commit 93ab173
Show file tree
Hide file tree
Showing 5 changed files with 2,609 additions and 989 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,8 @@ jobs:
run: tar -xvf *.tar

- uses: actions/setup-node@v4
if: ${{ matrix.rn-version == '0.65.3' }}
with:
node-version: 18

- uses: actions/setup-node@v4
if: ${{ matrix.rn-version != '0.65.3' }}
with:
node-version: 18
node-version: 20

- uses: actions/setup-java@v3
with:
Expand Down
14 changes: 7 additions & 7 deletions test/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc --project tsconfig.build.json",
"test": "jest"
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
},
"license": "MIT",
"devDependencies": {
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"appium": "^2.0.0-beta.46",
"appium-uiautomator2-driver": "^2.12.1",
"appium-xcuitest-driver": "^4.16.6",
"babel-jest": "^29.3.1",
"jest": "^29.3.1",
"appium": "^2.4.1",
"appium-uiautomator2-driver": "^2.39.0",
"appium-xcuitest-driver": "^5.13.0",
"babel-jest": "^29.7.0",
"jest": "^29.7.0",
"typescript": "4.1.3",
"webdriverio": "7.26.0"
"webdriverio": "^8.27.0"
}
}
22 changes: 11 additions & 11 deletions test/e2e/test/utils/fetchEvent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Event } from '@sentry/types';
import fetch, { Request } from 'node-fetch';

const domain = 'sentry.io';
const eventEndpoint = '/api/0/projects/sentry-sdks/sentry-react-native/events/';
Expand All @@ -20,16 +19,17 @@ const fetchEvent = async (eventId: string): Promise<ApiEvent> => {
expect(process.env.SENTRY_AUTH_TOKEN).toBeDefined();
expect(process.env.SENTRY_AUTH_TOKEN?.length).toBeGreaterThan(0);

const request = new Request(url, {
headers: {
Authorization: `Bearer ${process.env.SENTRY_AUTH_TOKEN}`,
'Content-Type': 'application/json',
},
method: 'GET',
});
const request = () =>
fetch(url, {
headers: {
Authorization: `Bearer ${process.env.SENTRY_AUTH_TOKEN}`,
'Content-Type': 'application/json',
},
method: 'GET',
});

let retries = 0;
const retryer = (jsonResponse: any) =>
const retryer: (json: any) => Promise<ApiEvent> = (jsonResponse: any) =>
new Promise((resolve, reject) => {
if (jsonResponse.detail === 'Event not found') {
if (retries < RETRY_COUNT) {
Expand All @@ -38,7 +38,7 @@ const fetchEvent = async (eventId: string): Promise<ApiEvent> => {
// eslint-disable-next-line no-console
console.log(`Retrying api request. Retry number: ${retries}`);
resolve(
fetch(request)
request()
.then(res => res.json())
.then(retryer),
);
Expand All @@ -51,7 +51,7 @@ const fetchEvent = async (eventId: string): Promise<ApiEvent> => {
}
});

const json: ApiEvent = (await fetch(request)
const json: ApiEvent = (await request()
// tslint:disable-next-line: no-unsafe-any
.then(res => res.json())
.then(retryer)) as ApiEvent;
Expand Down
Loading

0 comments on commit 93ab173

Please sign in to comment.