diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00c64d50..179cb309 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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 diff --git a/Makefile b/Makefile index 205af4b6..8cb4e7a1 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/vetiver-testing/setup-rsconnect/dump_api_keys.py b/vetiver-testing/setup-rsconnect/dump_api_keys.py index eebef59f..cfee5ad6 100644 --- a/vetiver-testing/setup-rsconnect/dump_api_keys.py +++ b/vetiver-testing/setup-rsconnect/dump_api_keys.py @@ -13,9 +13,9 @@ def get_api_key(user, password, email): api_keys = { - "admin": get_api_key("admin", "admin0", "admin@example.com"), - "susan": get_api_key("susan", "susan", "susan@example.com"), - "derek": get_api_key("derek", "derek", "derek@example.com"), + "admin": get_api_key("admin", "Km(7N0L*J", "admin@example.com"), + "susan": get_api_key("susan", "Km(7N0L*J", "susan@example.com"), + "derek": get_api_key("derek", "Km(7N0L*J", "derek@example.com"), } json.dump(api_keys, open(OUT_FILE, "w")) diff --git a/vetiver-testing/setup-rsconnect/users.txt b/vetiver-testing/setup-rsconnect/users.txt index dd4ec359..d780a347 100644 --- a/vetiver-testing/setup-rsconnect/users.txt +++ b/vetiver-testing/setup-rsconnect/users.txt @@ -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 diff --git a/vetiver-testing/wait_for_connect.sh b/vetiver-testing/wait_for_connect.sh new file mode 100755 index 00000000..aa3ea6b9 --- /dev/null +++ b/vetiver-testing/wait_for_connect.sh @@ -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' \ No newline at end of file