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

Make hostname:port configurable for test server. #207

Merged
merged 1 commit into from
Feb 23, 2020

Conversation

Namek
Copy link
Contributor

@Namek Namek commented Feb 20, 2020

Solves #205

What?

There are 4 new options for mint test:

  • host
  • port
  • browser_host
  • browser_port

Running test using Docker:

mint test --manual --host 0.0.0.0

This launches test server on host 0.0.0.0 which is available outside of the Docker container but also sets --browser-host to 127.0.0.1 by default which is a connection address for websocket outside the container. Same with port/browser_port pair.

Full instruction will be at mint-lang/mint-docker#1

@Namek Namek force-pushed the tests-configurable_hostname_port branch from 5a5e6fb to 362b768 Compare February 20, 2020 21:50
@@ -110,6 +111,7 @@ module Mint
</body>
</html>
HTML
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
HTML
HTML

@@ -8,7 +8,8 @@ module Mint
})
end

PAGE = <<-HTML
def get_page
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def get_page
def page_source : String

@@ -282,7 +285,7 @@ module Mint
get "/" do
@failed = [] of Message
@succeeded = 0
PAGE
get_page
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
get_page
page_source

@Namek Namek force-pushed the tests-configurable_hostname_port branch 3 times, most recently from b22ef40 to 8823052 Compare February 20, 2020 22:15
@@ -8,7 +8,8 @@ module Mint
})
end

PAGE = <<-HTML
def page_source : String
<<-HTML
Copy link
Member

@Sija Sija Feb 20, 2020

Choose a reason for hiding this comment

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

It makes sense to memoize it since it's not a constant anymoar.

Suggested change
<<-HTML
@page_source ||= <<-HTML

@Namek
Copy link
Contributor Author

Namek commented Feb 20, 2020

Please don't merge it until my signal. I want to make it work on Windows first.

@Namek Namek force-pushed the tests-configurable_hostname_port branch 3 times, most recently from b813ca8 to 6f63a0f Compare February 20, 2020 23:41
@Namek
Copy link
Contributor Author

Namek commented Feb 21, 2020

@Sija @gdotdesign It works, I have also updated the PR description. Please re-review and merge if it's OK.

src/test_runner.cr Outdated Show resolved Hide resolved
@Namek Namek force-pushed the tests-configurable_hostname_port branch from 6f63a0f to e4c7b6f Compare February 22, 2020 13:35
src/commands/test.cr Outdated Show resolved Hide resolved
src/commands/test.cr Outdated Show resolved Hide resolved
@Namek Namek force-pushed the tests-configurable_hostname_port branch from e4c7b6f to 12b71f8 Compare February 22, 2020 15:43
@gdotdesign gdotdesign merged commit 99ef836 into mint-lang:master Feb 23, 2020
@gdotdesign
Copy link
Member

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants