Skip to content
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

Integration Flakey Test Fixes #572

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ jobs:
test-rsconnect:
name: "Integration tests against latest Connect"
runs-on: ubuntu-latest
env:
RSC_LICENSE: ${{ secrets.RSC_LICENSE }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
Expand All @@ -190,9 +192,6 @@ jobs:
docker compose up --build -d
pip freeze > requirements.txt
make dev
env:
RSC_LICENSE: ${{ secrets.RSC_LICENSE }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Get logs in case of failure
run: |
docker compose logs rsconnect
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ RSC_API_KEYS=vetiver-testing/rsconnect_api_keys.json

dev:
docker compose up -d
# Docker compose needs a little time to start up
sleep 4
vetiver-testing/wait_for_connect.sh
docker compose exec -T rsconnect bash < vetiver-testing/setup-rsconnect/add-users.sh
python vetiver-testing/setup-rsconnect/dump_api_keys.py $(RSC_API_KEYS)

Expand Down
6 changes: 3 additions & 3 deletions vetiver-testing/setup-rsconnect/dump_api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def get_api_key(user, password, email):


api_keys = {
"admin": get_api_key("admin", "admin0", "[email protected]"),
"susan": get_api_key("susan", "susan", "[email protected]"),
"derek": get_api_key("derek", "derek", "[email protected]"),
"admin": get_api_key("admin", "Km(7N0L*J", "[email protected]"),
"susan": get_api_key("susan", "Km(7N0L*J", "[email protected]"),
"derek": get_api_key("derek", "Km(7N0L*J", "[email protected]"),
}

json.dump(api_keys, open(OUT_FILE, "w"))
8 changes: 4 additions & 4 deletions vetiver-testing/setup-rsconnect/users.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
admin admin0
test test
susan susan
derek derek
admin Km(7N0L*J
test Km(7N0L*J
susan Km(7N0L*J
derek Km(7N0L*J
7 changes: 7 additions & 0 deletions vetiver-testing/wait_for_connect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
timeout 30 bash -c \
'status=$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3939/__ping__); \
while [[ "$status" != "200" ]]; \
do sleep 1; \
echo "retry"; \
status=$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3939/__ping__); \
done'
Loading