-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add example tester
service to show API Integration Testing of a Goa System
#331
Conversation
add readme file (still need to fill out)
tester readme update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!! Left a bunch of nitpicks and comments
Implement review comment changes
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #331 +/- ##
=======================================
Coverage 94.30% 94.30%
=======================================
Files 40 40
Lines 2249 2249
=======================================
Hits 2121 2121
Misses 95 95
Partials 33 33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Trying out a workflow to run integration tests against local binaries
…tPanic Get Stack Trace to Err Log on Panic
small fixes for style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, added a nit
.github/workflows/integration.yaml
Outdated
./bin/locator -monitoring-enabled=false & | ||
./bin/tester -monitoring-enabled=false & | ||
./bin/front -monitoring-enabled=false & | ||
sleep 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we couldn't instead wait for the service health checks to start responding? Using sleep
really isn't great... Maybe we could introduct a function such as:
check_service_health() {
local health_url="$1"
local start_time=$(date +%s)
while : ; do
if curl -s --fail "$health_url" > /dev/null; then
echo "Service is up!"
return 0
fi
local current_time=$(date +%s)
if (( current_time - start_time >= 5 )); then
echo "Timed out waiting for service to be up."
return 1
fi
sleep 0.2
done
}
and then call it for each service concurrently and wait for the calls to return:
check_service_health "http://localhost:????/healthz" &
check_service_health "http://localhost:????/healthz" &
check_service_health "http://localhost:????/healthz" &
check_service_health "http://localhost:????/healthz" &
wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to tweak it a bit and add -n to the wait (otherwise it just hung) but this was a great suggestion, thanks!
example/weather/scripts/setup
Outdated
@@ -9,10 +9,21 @@ source ./scripts/utils/common.sh | |||
|
|||
proto_pkg="protobuf-compiler" | |||
|
|||
# install protoc, update version as needed | |||
PROTO_VER=24.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest version is 25.1 - it's a race! :)
protoc -> 25.1, better wait in integration.yaml
Thank you for the awesome contribution! |
… System (#331) * initial commit * Empty-Commit * add readme file (still need to fill out) * tester readme update * Trying out a workflow to run integration tests against local binaries * Add proto install to /example/weather/scripts/setup * fix integration.yaml * disable mono on ubuntu * move mono stop * Try to find out what's running on 8084 * Trying to disable mono? * trying to stop mono 2 * add a sleep after stop/disable? * add some echo * see if stop/disable mono fails * add back in || true, change front ports to see if this even works at all * oops forgot to change int test port * try no send to dev null? * sleep before testing * take out netstat * sleep longer? give time for docker to do work to get grafana? * remove dev>null again... :\ * sleep 60 :( * Implement review comment changes * Fix runTests check for filtering if * Empty-Commit * try starting each service individually, check fo rmono * just KILL mono? * back to 8084, check all ports * fix typo * add flag to turn off grafana for services (for CI testing) * clean up integration.yaml script * review fixes * Get Stack Trace to Err Log on Panic * small fixes for style * protoc -> 25.1, better wait in integration.yaml * Add synchronous testing feature * Make one of the synchronous as an example * move func maps to service definition
* Switch to using OpenTelemetry for both tracing and metrics This commit replaces the `metrics` and `trace` packages with a new `clue` package that leverages OpenTelemetry for instrumenting metrics and traces. See the README for instructions on how to upgrade. * Add tests * Remove coupling on Goa middleware * Use GRPC stat.handler for tracing in gRPC (#349) This replaces the deprecated use of interceptors. See open-telemetry/opentelemetry-go-contrib#3002. Remove use of Goa request ID middleware. This is superseded by logging span IDs. * Add example `tester` service to show API Integration Testing of a Goa System (#331) * initial commit * Empty-Commit * add readme file (still need to fill out) * tester readme update * Trying out a workflow to run integration tests against local binaries * Add proto install to /example/weather/scripts/setup * fix integration.yaml * disable mono on ubuntu * move mono stop * Try to find out what's running on 8084 * Trying to disable mono? * trying to stop mono 2 * add a sleep after stop/disable? * add some echo * see if stop/disable mono fails * add back in || true, change front ports to see if this even works at all * oops forgot to change int test port * try no send to dev null? * sleep before testing * take out netstat * sleep longer? give time for docker to do work to get grafana? * remove dev>null again... :\ * sleep 60 :( * Implement review comment changes * Fix runTests check for filtering if * Empty-Commit * try starting each service individually, check fo rmono * just KILL mono? * back to 8084, check all ports * fix typo * add flag to turn off grafana for services (for CI testing) * clean up integration.yaml script * review fixes * Get Stack Trace to Err Log on Panic * small fixes for style * protoc -> 25.1, better wait in integration.yaml * Add synchronous testing feature * Make one of the synchronous as an example * move func maps to service definition * Remove use of legacy flag --------- Co-authored-by: Jason Borneman <[email protected]>
goa v3.11.0
->goa 3.14.0
// Code generated by
comment + changinginterface{}
toany
tester
servicefront
that wrap thetester
service'sTestAll
andTestSmoke
methods