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

Move httpbin to test-poll-curl.R? #374

Closed
MichaelChirico opened this issue Oct 9, 2023 · 2 comments
Closed

Move httpbin to test-poll-curl.R? #374

MichaelChirico opened this issue Oct 9, 2023 · 2 comments

Comments

@MichaelChirico
Copy link

httpbin <- webfakes::new_app_process(
webfakes::httpbin_app(),
opts = webfakes::server_opts(num_threads = 6)
)

This requires Suggests package 'webfakes', but is only used in 'test-poll-curl.R'. It would be better to isolate the dependency of the tests on 'webfakes' to just one test file instead of all files (as helper.R is run before all tests).

Happy to file the PR if you agree.

@MichaelChirico
Copy link
Author

Moreover every test in test-poll-curl.R is a skip_on_cran() test, so that object is not needed "most of the time" anyway.

@gaborcsardi
Copy link
Member

Moving it to a test file creates a much worse development workflow, so I am not going to do that.

Btw. it takes about 0.01s to run that code, or 0.06 is one needs to cold-load the webfakes package:

❯ system.time(httpbin <- webfakes::new_app_process(
+   webfakes::httpbin_app(),
+   opts = webfakes::server_opts(num_threads = 6)
+ )
+ )
   user  system elapsed
  0.006   0.005   0.011

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

No branches or pull requests

2 participants