Skip to content
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: Tune integration tests #399

Merged
merged 5 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
include:
- os: macos-13
- os: macos-14
xcode: '15.2'
ios: '17.2'
device: iPhone 15
Expand All @@ -20,6 +20,8 @@ jobs:
PLATFORM_VERSION: ${{ matrix.ios }}
XCODE_VERSION: ${{ matrix.xcode }}
DEVICE_NAME: ${{ matrix.device }}
_LOG_TIMESTAMP: 1
_FORCE_LOGS: 1
CI: true
steps:
- uses: actions/checkout@v3
Expand All @@ -39,6 +41,4 @@ jobs:
xcrun simctl bootstatus $udid -b
xcrun simctl openurl $udid "https://google.com" &
- run: npm install
- run: |
export PATH="${PATH}:$(python -c 'import site; print(site.USER_BASE)')/bin"
_FORCE_LOGS=1 npm run e2e-test
- run: npm run e2e-test
35 changes: 15 additions & 20 deletions test/functional/safari-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function deleteDeviceWithRetry (udid) {
}

describe('Safari remote debugger', function () {
this.timeout(480000);
this.timeout(610000);
this.retries(2);

let chai;
Expand All @@ -42,6 +42,8 @@ describe('Safari remote debugger', function () {
/** @type {string} */
let address;
before(async function () {
const portPromise = startHttpServer();

chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');
chai.should();
Expand All @@ -53,20 +55,10 @@ describe('Safari remote debugger', function () {
sim = await getSimulator(udid);
simCreated = true;
}
// on certain system, particularly Xcode 11 on Travis, starting the sim fails
await retry(4, async function () {
try {
await sim.run({
startupTimeout: 60000,
});
} catch (err) {
await sim.shutdown();
throw err;
}
await sim.run({
startupTimeout: process.env.CI ? 600000 : 120000,
});

const port = await startHttpServer();
address = `http://localhost:${port}`;
address = `http://localhost:${await portPromise}`;
});
after(async function () {
await sim.shutdown();
Expand All @@ -92,12 +84,15 @@ describe('Safari remote debugger', function () {
logAllCommunicationHexDump: false,
}, false);

await sim.openUrl(address);

await rd.connect(process.env.CI ? 180000 : 5000);
if (_.isEmpty(rd.appDict)) {
throw new Error('The remote debugger did not return any connected applications');
}
const maxRetries = process.env.CI ? 10 : 2;
await retry(maxRetries, async () => await sim.openUrl(address));
await retry(maxRetries, async () => {
await rd.connect(60000);
if (_.isEmpty(rd.appDict)) {
await rd.disconnect();
throw new Error('The remote debugger did not return any connected applications');
}
});
});
afterEach(async function () {
await rd?.disconnect();
Expand Down
Loading