Skip to content

ci: Use a custom httpbin instance in tests#167

Merged
janbuchar merged 19 commits intomasterfrom
local-httpbin
Nov 18, 2024
Merged

ci: Use a custom httpbin instance in tests#167
janbuchar merged 19 commits intomasterfrom
local-httpbin

Conversation

@janbuchar
Copy link
Copy Markdown
Collaborator

@janbuchar janbuchar added the t-tooling Issues with this label are in the ownership of the tooling team. label Jun 3, 2024
@janbuchar janbuchar requested a review from vdusek June 3, 2024 09:02
@github-actions github-actions bot added this to the 91st sprint - Tooling team milestone Jun 3, 2024
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Jun 3, 2024
janbuchar added a commit that referenced this pull request Jun 3, 2024
This is the non-controversial part of #167.
@vdusek
Copy link
Copy Markdown
Collaborator

vdusek commented Jun 4, 2024

I believe we can convert this to a draft for now?

@janbuchar janbuchar marked this pull request as draft June 4, 2024 13:35
@vdusek vdusek removed this from the 91st sprint - Tooling team milestone Sep 4, 2024
@janbuchar janbuchar changed the title ci: Use a local httpbin instance for tests ci: Use httpbingo.org in tests Nov 14, 2024
@janbuchar janbuchar changed the title ci: Use httpbingo.org in tests ci: Use a custom httpbin instance in tests Nov 15, 2024
@janbuchar janbuchar marked this pull request as ready for review November 15, 2024 16:16
Copy link
Copy Markdown
Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finishing this!

I have just one nit pick regarding the string conversion, and one suggestion for further improvement (maybe even a bug fix). But let's do it in a separate PR as it is not ci-related.

pass

await crawler.run(['https://example.com', 'https://httpbin.org'])
await crawler.run(['https://example.com', f'{httpbin}'])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we use just str(httpbin)?

async def test_open_and_close_page(controller: PlaywrightBrowserController, httpbin: str) -> None:
async def test_open_and_close_page(controller: PlaywrightBrowserController, httpbin: URL) -> None:
page = await controller.new_page()
await page.goto(f'{httpbin}')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please update it here to only str(httpbin) as well?

Comment on lines +130 to +134
if (
context.session
and status_code not in self._http_client._ignore_http_error_status_codes # noqa: SLF001
and context.session.is_blocked_status_code(status_code=status_code)
):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering whether this part should not look more like this:

if context.session and context.session.is_blocked_status_code(
    status_code=status_code,
    additional_blocked_status_codes=self._http_client.additional_blocked_status_codes,
    ignore_http_error_status_codes=self._http_client.ignore_http_error_status_codes
):

which would require further changes as well, but since you're touching it here, I'm mentioning it ... Maybe do it in other PR. If I am not overlooking anything.

@janbuchar janbuchar merged commit c80812c into master Nov 18, 2024
@janbuchar janbuchar deleted the local-httpbin branch November 18, 2024 15:02
janbuchar added a commit that referenced this pull request Nov 18, 2024
part of #167 that I forgot to push - sorry @vdusek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run httpbin locally instead of using httpbin.org

2 participants