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

Converted balancer and backend to APIcast::Blackbox #1418

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hector-vido
Copy link
Contributor

I just converted t/backend.t and t/balancer.t to Test::APIcast::Blackbox.

This is probably an almost useless modification but if this is right, I can convert the more complex other ones.

Thanks!

@hector-vido hector-vido requested a review from a team as a code owner October 31, 2023 03:07
This was referenced Oct 31, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should delete this file because it really doesn't check anything.
cc @eguzki

Copy link
Member

Choose a reason for hiding this comment

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

APIcast has configured a virtualhost backend, listening on 8081 and configured with conf.d/backend.conf. Not really used in production, but widely used in dev environments to mock backend and in the tests environments.

It makes sense to me to test that this virtualhost backend exists and returns what the mocked backend does, which is return a 200 OK with the body transactions authrep!

The other alternative is to remove the virtualhost backend and run some mock server in another container for tests. Then it would make sense to remove this test IMO.

Anyway, the new implementation of this backend.t is not testing the backend virtualhost. The request should hit the backend virtualhost directly.

Copy link
Contributor Author

@hector-vido hector-vido Nov 1, 2023

Choose a reason for hiding this comment

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

@eguzki or @tkan145 any ideas on how to add a different port in the --- request section?
Since the port is randomized in Test/APIcast/Blackbox.pm I can't find a way to talk directly with the backend listening in 8081.
Don't know if this is the right path, but I added a section for sites_d:

--- sites_d
server {
  listen *:8081;
  server_name backend;
  include "/opt/app-root/src/gateway/conf.d/backend.conf";
}

It is working from outside the test script.

Copy link
Contributor

Choose a reason for hiding this comment

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

This test is covered in #1416 . A small suggestion is to check existing PR(s) to avoid duplicating efforts. Good work on this one though.

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.

None yet

3 participants