Repository navigation
feat: add the smocker HTTP mock preset - #51
Merged
Merged
Conversation
…ntainer With no host port, the dashboard only existed once someone set the domain by hand, and setting it made lerd env point SMOCKER_URL at the domain, which serves the admin API, so an app's outgoing calls answered 405 and never reached the mock. Smocker is reached server to server, so it needs no domain: the admin UI is published for the dashboard, and both URLs stay on the container name, which works the same on every lerd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Smocker, an HTTP mock server for testing webhooks and other outgoing requests, as a preset.
How it runs
http://lerd-smocker:8080. The admin API and UI (mocks, history, reset) are served on the service domain, so nothing is bound on the host and the preset cannot clash with whatever else runs there.domain: smockerwithdomain_port: 8081, so the domain lands on the admin API and UI rather than the mock server. As with mosparo, lerd only adopts a preset's domain for the built-in defaults today, so it has to be set by hand withlerd service domain smocker smocker.test. The field is kept so it applies once store presets are adopted too.lerd envwritesSMOCKER_URL=http://lerd-smocker:8080andSMOCKER_ADMIN_URL=https://smocker.test.env_detecttriggers onSMOCKER_URL.ghcr.io/smocker-dev/smocker:1.0.0. The listen ports are set explicitly throughSMOCKER_MOCK_SERVER_LISTEN_PORTandSMOCKER_CONFIG_LISTEN_PORT.testing, next to stripe-mock.Smocker, set explicitly since some places show the label verbatim rather than capitalizing the name.#b31729is the grill's red.Checks
test_render_schema.py,render_schema.pyandreadme_logos.pywere run, and their output is committed.schema_guard.pypasses againstmain.lerd service preset smockerwithLERD_SERVICES_BASE_URLpointed at this branch:lerd service domain smocker smocker.test,https://smocker.testserves the UI from the host and answers the admin API from inside a PHP container./mockswith a Luadynamic_responseanswers onhttp://lerd-smocker:8080from a PHP container with the scripted status and a 1s delay, and the call shows up in/history.