-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement tests as GitHub workflow #23
Conversation
### Fauna ### | ||
.fauna* | ||
|
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.
We should check with the Fauna shell team to be sure no files are intended to be checked in when working on a team.
test/requests.http
Outdated
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.
from the discussion yesterday it sounds like we want to produce a test suite that's more native to the sample app. So JUnit in this case.
test/validate.sh
Outdated
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.
if we're producing JUnit this doesn't matter much, but providing feedback for general bash improvements.
- I don't think we should write files unless absolutely required
- use a var for all of the common curl options, and don't use shorthand in scripts (we still have a lot of this everywhere, but trying to be better about it)
- separate flags to new lines
result:
CURL_OPTS='--silent --header "Accept: application/json" --header "Content-Type: application/json"'
PAGE_ONE_=$(curl $CURL_OPTS \
--retry-all-errors \
--connect-timeout 5 \
--max-time 10 \
--retry 5 \
--retry-delay 10 \
--retry-max-time 60 \
"$ENDPOINT/products?pageSize=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 agree with all 3 points here.
On points 1 and 2, I tried to use the syntax you proposed here, but it doesn't seem to work. CURL_OPTS is not getting split into multiple arguments, and it seems to hang when I try and pass the output of curl into a variable. 🤔
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.
you could eval, but I actually think this pattern would be best:
CURL_OPTS=(
"--silent"
"--show-error"
"--fail"
"--connect-timeout" "2"
"--max-time" "2"
)
# just throwing in a verbose to demonstrate we can append more opts if needed
curl "${CURL_OPTS[@]}" --verbose "$ENDPOINT/products?pageSize=1"
Co-authored-by: Darren Cunningham <darren.cunningham@fauna.com>
Add scripts to setup DB using local container and validate sample app:
All of this work should be copyable to the other sample apps (e.g. Python).
.github
to install JVM, fauna docker container, and fauna-shell.test/setup.sh
to configure the test database.test/validate.sh