-
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
Merged
Merged
Changes from 27 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
6f054d6
initial commit
jasondborneman 023ece6
Empty-Commit
jasondborneman 836488c
Merge pull request #1 from jasondborneman/initial
jasondborneman 5d9f33c
add readme file (still need to fill out)
jasondborneman ced1c63
Merge pull request #2 from jasondborneman/initial
jasondborneman c0d8ebb
tester readme update
jasondborneman e7fe66e
Merge pull request #3 from jasondborneman/jdb/tester/readme
jasondborneman 4e59ab6
Trying out a workflow to run integration tests against local binaries
jasondborneman 9404ef6
Add proto install to /example/weather/scripts/setup
jasondborneman 090cb8c
fix integration.yaml
jasondborneman 4dd01db
disable mono on ubuntu
jasondborneman e822a6d
move mono stop
jasondborneman 9883817
Try to find out what's running on 8084
jasondborneman a23d09d
Trying to disable mono?
jasondborneman 9868199
trying to stop mono 2
jasondborneman f789909
add a sleep after stop/disable?
jasondborneman a87729c
add some echo
jasondborneman 55a7c09
see if stop/disable mono fails
jasondborneman d6cb3da
add back in || true, change front ports to see if this even works at all
jasondborneman 5f90a03
oops forgot to change int test port
jasondborneman e819d44
try no send to dev null?
jasondborneman 83a9691
sleep before testing
jasondborneman 54af7a6
take out netstat
jasondborneman c99addc
sleep longer? give time for docker to do work to get grafana?
jasondborneman 072f246
remove dev>null again... :\
jasondborneman 5e51620
sleep 60 :(
jasondborneman ad0ff0c
Implement review comment changes
jasondborneman 0787db5
Merge pull request #5 from jasondborneman/jdb/tester/fixes112723
jasondborneman e1cd514
Fix runTests check for filtering if
jasondborneman 2212857
Empty-Commit
jasondborneman 3cebc13
Merge pull request #6 from jasondborneman/jdb/tester/fixes112723_2
jasondborneman 7c7495a
Merge branch 'main' into jdb/tester/workflow
jasondborneman c439738
try starting each service individually, check fo rmono
jasondborneman c2dec1a
just KILL mono?
jasondborneman 104c195
back to 8084, check all ports
jasondborneman 89be0d0
fix typo
jasondborneman 3817ebc
add flag to turn off grafana for services (for CI testing)
jasondborneman 09062f1
clean up integration.yaml script
jasondborneman ad19923
Merge pull request #4 from jasondborneman/jdb/tester/workflow
jasondborneman eb0f830
review fixes
jasondborneman 2bcd647
Merge pull request #7 from jasondborneman/jdb/tester/reviewfixes112823_1
jasondborneman 591c3cb
Get Stack Trace to Err Log on Panic
jasondborneman fbddd73
Merge pull request #8 from jasondborneman/jdb/tester/errlogStackOnTes…
jasondborneman 1a94d26
small fixes for style
jasondborneman 715bd6e
Merge pull request #9 from jasondborneman/jdb/tester/smallfixes
jasondborneman 5245d74
protoc -> 25.1, better wait in integration.yaml
jasondborneman eb6442f
Merge pull request #10 from jasondborneman/jdb/tester/workflow_fixes
jasondborneman ec3bc45
Add synchronous testing feature
jasondborneman ac71471
Make one of the synchronous as an example
jasondborneman adb3695
Merge pull request #11 from jasondborneman/jdb/tester/synchronoustests
jasondborneman d689bd6
Merge branch 'main' into merge-latest
jasondborneman 78ca536
move func maps to service definition
jasondborneman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Integration Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
integration-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
- name: tests | ||
run: | | ||
echo "stop/disable/kill mono" | ||
sudo systemctl stop mono-xsp4.service || true | ||
sudo systemctl disable mono-xsp4.service || true | ||
sudo pkill mono || true | ||
echo "change to weather example directory" | ||
cd example/weather | ||
echo "run setup script" | ||
./scripts/setup | ||
echo "run server" | ||
./bin/forecaster -monitoring-enabled=false & | ||
./bin/locator -monitoring-enabled=false & | ||
./bin/tester -monitoring-enabled=false & | ||
./bin/front -monitoring-enabled=false & | ||
sleep 1 | ||
echo "-----RUN TESTS-----" | ||
results=$(curl -X POST http://localhost:8084/tester/smoke) | ||
echo "-----RESULTS-----" | ||
echo $results | ||
echo "----------" | ||
if [ $(echo $results | jq '.fail_count') -gt 0 ]; | ||
then | ||
echo "Test errors found." | ||
exit 1 | ||
else | ||
echo "Tests passed." | ||
exit 0 | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Latest version is 25.1 - it's a race! :) |
||
|
||
if is_mac; then | ||
PROTOC_ZIP=protoc-${PROTO_VER}-osx-universal_binary.zip | ||
proto_pkg="protobuf" | ||
else | ||
PROTOC_ZIP=protoc-${PROTO_VER}-linux-x86_64.zip | ||
fi | ||
|
||
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTO_VER}/${PROTOC_ZIP} | ||
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc | ||
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*' | ||
rm -f $PROTOC_ZIP | ||
|
||
check_required_cmd "protoc" $proto_pkg | ||
|
||
if [[ "$CI" == "" ]]; then | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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:and then call it for each service concurrently and wait for the calls to return:
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!