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

Allow test host to be customized #167

Merged
merged 2 commits into from
Jul 1, 2023

Conversation

astrofrog
Copy link
Contributor

I ran into the same issue as #112 but when running solara though the pytest framework which means I wasn't able to set the host to 0.0.0.0. This PR adds a way to customize the host with a new environment variable. I thought HOST would be too generic so made it SOLARA_TEST_HOST. I wonder if PORT should be SOLARA_TEST_PORT too?

and the ports configurable via the command line for pytest.

## Changing the Hostname

To configure the hostname the socket is bound to when starting the test server, use the `HOST` or `SOLARA_HOST` environment variable (e.g. `SOLARA_HOST=0.0.0.0`). This hostname is also used for the jupyter server and voila. Alternatively the `--solara-host` argument can be passed on the command line for pytest.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is SOLARA_HOST actually recognized currently?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I've added that in this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that should be good enough for when HOST is not specific enough, and collides with other usage. And in the case where even that is not enough, --solara-host can be used for the testing host. I think that provides enough configuration/escape hatches.

@maartenbreddels maartenbreddels merged commit 30b3e33 into widgetti:master Jul 1, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants