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

[CI mode, ember-cli test] enabling WebSocket proxying #1765

Merged
merged 3 commits into from
Feb 22, 2024

Conversation

IBue
Copy link
Contributor

@IBue IBue commented Feb 12, 2024

simple patch leveraging WebSocket proxying capabilities of http-proxy by an entry identifying itself as "ws: true" in the testem.json/testem.js 'proxies' section
(cf. https://github.com/testem/testem?tab=readme-ov-file#api-proxy):


…
  "proxies": {
    …
    "/mywsendpoint": {
      …
      ws: true
    },
    …
  }

Works with ember-cli test, offering equivalent functionality to ember-cli server --proxy=… in CI testing mode.

simple patch leveraging WebSocket proxying capabilities of
http-proxy by an entry identifying itself as "ws: true" in the testem.json/testem.js
'proxies' section
(cf. https://github.com/testem/testem?tab=readme-ov-file#api-proxy):

…
  "proxies": {
    …
    "/mywsendpoint": {
      …
      ws: true
    },
    …
  }

Works with ember-cli test, offering equivalent functionality to ember-cli server --proxy=… in CI testing mode.
Copy link
Member

@johanneswuerbach johanneswuerbach left a comment

Choose a reason for hiding this comment

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

Overall looks good, but it would be great to get a test.

});

Object.keys(proxies).forEach(url => {
Object.keys(proxies).forEach((url) => {
if (proxies[url].ws === true) {
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to add a test for this? Here are the existing ones https://github.com/testem/testem/blob/master/tests/server_tests.js

@IBue
Copy link
Contributor Author

IBue commented Feb 22, 2024

I worked out the tests for ws → ws/wss proxying.

@johanneswuerbach johanneswuerbach merged commit b4bcb6f into testem:master Feb 22, 2024
8 checks passed
@johanneswuerbach
Copy link
Member

Released in testem@3.12.0, thanks for your contribution 🤩

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