### GET /v0/start Source: https://github.com/hermeticbuild/rules_itest/blob/master/docs/itest.md Starts a service if it is not already running. ```APIDOC ## GET /v0/start?service={label} ### Description Starts the service if it is not already running. ### Method GET ### Endpoint /v0/start?service={label} ### Parameters #### Query Parameters - **service** (string) - Required - The label of the service to start. ### Response #### Success Response (200) - **status** (integer) - 200 if the service was started successfully. #### Response Example 200 ``` -------------------------------- ### service_test Example Usage Source: https://github.com/hermeticbuild/rules_itest/blob/master/docs/itest.md An example showing how to define a test target and wrap it with the service_test rule to include required services. ```starlark go_test( name = "_example_test_no_services", srcs = [..], tags = ["manual"], ) service_test( name = "example_test", test = ":_example_test_no_services", services = [ "//services/mysql", ... ], ) ``` -------------------------------- ### GET /v0/wait Source: https://github.com/hermeticbuild/rules_itest/blob/master/docs/itest.md Waits for a service to exit and returns the exit code in the response body. ```APIDOC ## GET /v0/wait?service={label} ### Description Waits for the service to exit and returns the exit code in the body. ### Method GET ### Endpoint /v0/wait?service={label} ### Parameters #### Query Parameters - **service** (string) - Required - The label of the service to wait for. ### Response #### Success Response (200) - **exit_code** (integer) - The exit code of the service. #### Response Example 0 ``` -------------------------------- ### GET /v0/port Source: https://github.com/hermeticbuild/rules_itest/blob/master/docs/itest.md Returns the assigned port for a given service label. May be a named port. ```APIDOC ## GET /v0/port?service={label} ### Description Returns the assigned port for the given label. May be a named port. ### Method GET ### Endpoint /v0/port?service={label} ### Parameters #### Query Parameters - **service** (string) - Required - The label of the service. ### Response #### Success Response (200) - **port** (integer) - The assigned port number. #### Response Example 8080 ``` -------------------------------- ### GET /v0/kill Source: https://github.com/hermeticbuild/rules_itest/blob/master/docs/itest.md Sends a kill signal to a running service. Optionally specify the signal to send. ```APIDOC ## GET /v0/kill?service={label}[&signal={signal}] ### Description Sends a kill signal to the service if it is running. Optionally specify the signal to send (valid values: SIGTERM and SIGKILL). ### Method GET ### Endpoint /v0/kill?service={label}[&signal={signal}] ### Parameters #### Query Parameters - **service** (string) - Required - The label of the service to kill. - **signal** (string) - Optional - The signal to send. Valid values: SIGTERM and SIGKILL. ### Response #### Success Response (200) - **status** (integer) - 200 if the signal was sent successfully. #### Response Example 200 ``` -------------------------------- ### GET /v0/healthcheck Source: https://github.com/hermeticbuild/rules_itest/blob/master/docs/itest.md Checks the health of a service. Returns 200 if the service is healthy, 503 otherwise. ```APIDOC ## GET /v0/healthcheck?service={label} ### Description Returns 200 if the service is healthy, 503 otherwise. ### Method GET ### Endpoint /v0/healthcheck?service={label} ### Parameters #### Query Parameters - **service** (string) - Required - The label of the service to check. ### Response #### Success Response (200) - **status** (integer) - 200 if the service is healthy. #### Response Example 200 #### Error Response (503) - **status** (integer) - 503 if the service is not healthy. #### Response Example 503 ``` -------------------------------- ### Run ibazel with enable-reload config Source: https://github.com/hermeticbuild/rules_itest/blob/master/README.md Invokes ibazel with the --config enable-reload flag to enable per-service reload for the target //path/to:target. This command pairs with the .bazelrc configuration above. ```shell ibazel run --config enable-reload //path/to:target ``` -------------------------------- ### Enable per-service reload with ibazel via .bazelrc Source: https://github.com/hermeticbuild/rules_itest/blob/master/docs/itest.md Adds the enable-reload config to .bazelrc to enable per-service reload when using ibazel. Use with 'ibazel run --config enable-reload //path/to:target'. ```bazelrc .bazelrc build:enable-reload --@rules_itest//:enable_per_service_reload fetch:enable-reload --@rules_itest//:enable_per_service_reload query:enable-reload --@rules_itest//:enable_per_service_reload ``` -------------------------------- ### Configure per-service reload flag in .bazelrc Source: https://github.com/hermeticbuild/rules_itest/blob/master/README.md Adds the Starlark flag --@rules_itest//:enable_per_service_reload to a .bazelrc config named enable-reload. This is needed because ibazel invokes cquery, which does not accept Starlark flags directly, so the flag must be passed via --config. ```bazelrc .bazelrc common:enable-reload --@rules_itest//:enable_per_service_reload ``` -------------------------------- ### service_test Rule Definition Source: https://github.com/hermeticbuild/rules_itest/blob/master/docs/itest.md The basic signature for the service_test rule, which loads from the rules_itest repository. ```starlark load("@rules_itest//:itest.bzl", "service_test") service_test(name, data, env, port_aliases, services, test) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.