Skip to content

Commit

Permalink
test: fix runner and enable passing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Mar 27, 2024
1 parent d0c4955 commit 5e6dbc2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
10 changes: 4 additions & 6 deletions tests/network/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ async def test_network_before_request_sent_event_with_data_url_emitted(


@pytest.mark.asyncio
@pytest.mark.skip(reason="TODO: #1080")
async def test_network_specific_context_subscription_does_not_enable_cdp_network_globally(
websocket, context_id, create_context, base_url):
await subscribe(websocket, ["network.beforeRequestSent"], [context_id])
Expand Down Expand Up @@ -451,7 +450,6 @@ async def test_network_sends_only_included_cookies(websocket, context_id,


@pytest.mark.asyncio
@pytest.mark.skip(reason="TODO: #1350")
async def test_network_should_not_block_queue_shared_workers_with_data_url(
websocket, context_id, base_url):

Expand All @@ -463,7 +461,7 @@ async def test_network_should_not_block_queue_shared_workers_with_data_url(
websocket, {
"method": "script.callFunction",
"params": {
"functionDeclaration": "() => {new SharedWorker('data:text/javascript,console.log(`hi`)');}",
"functionDeclaration": "() => {new SharedWorker('data:text/javascript,console.log(\"hi\")');}",
"target": {
"context": context_id
},
Expand All @@ -477,8 +475,8 @@ async def test_network_should_not_block_queue_shared_workers_with_data_url(
"method": "network.beforeRequestSent",
"params": {
"isBlocked": False,
"context": context_id,
"navigation": ANY_STR,
"context": None,
"navigation": None,
"redirectCount": 0,
"request": {
"request": ANY_STR,
Expand All @@ -491,7 +489,7 @@ async def test_network_should_not_block_queue_shared_workers_with_data_url(
"timings": ANY_DICT
},
"initiator": {
"type": "script"
"type": "other"
},
"timestamp": ANY_TIMESTAMP
}
Expand Down
4 changes: 2 additions & 2 deletions tools/bidi-server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ export function parseCommandLineArgs() {
.option('total-chunks', {
describe: 'If provided, will split tests into this many shards.',
type: 'number',
default: process.env.PYTEST_TOTAL_CHUNKS || 1,
default: Number(process.env.PYTEST_TOTAL_CHUNKS || 1),
})
.option('this-chunk', {
describe:
'If provided, will only run tests for this shard. Shard IDs are 0-indexed.',
type: 'number',
default: process.env.PYTEST_THIS_CHUNK || 0,
default: Number(process.env.PYTEST_THIS_CHUNK || 0),
})
.parseSync();
}
Expand Down
12 changes: 8 additions & 4 deletions tools/run-e2e.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,17 @@ const e2eArgs = ['run', 'pytest'];
e2eArgs.push(
'--verbose',
'-vv',
'--num-shards',
PYTEST_TOTAL_CHUNKS,
'--shard-id',
PYTEST_THIS_CHUNK,
// Do not throw an error if there are unused snapshots.
'--snapshot-warn-unused'
);
if (PYTEST_TOTAL_CHUNKS !== 1) {
e2eArgs.push(
'--num-shards',
PYTEST_TOTAL_CHUNKS,
'--shard-id',
PYTEST_THIS_CHUNK
);
}

if (argv.fileOrFolder) {
e2eArgs.push(argv.fileOrFolder);
Expand Down

0 comments on commit 5e6dbc2

Please sign in to comment.