diff --git a/.github/workflows/contract.yaml b/.github/workflows/contract.yaml index 1c50c1e99..86f5e6f3e 100644 --- a/.github/workflows/contract.yaml +++ b/.github/workflows/contract.yaml @@ -22,6 +22,10 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.11 + - name: quarto + uses: quarto-dev/quarto-actions/setup@v2 + with: + version: 1.4.549 - uses: extractions/setup-just@v1 - uses: actions/download-artifact@v3 diff --git a/test/bats/contract/deploy.bats b/test/bats/contract/deploy.bats index ee9fd00ab..4c12956b8 100644 --- a/test/bats/contract/deploy.bats +++ b/test/bats/contract/deploy.bats @@ -5,36 +5,45 @@ load '../node_modules/bats-assert/load' source ../content/bundles/${CONTENT}/test/.publisher-env CONTENT_PATH='../content/bundles/' +# helper funciton for deploys +deploy_assertion() { + if [[ ${quarto_r_content[@]} =~ ${CONTENT} ]]; then + assert_output --partial "error detecting content type: quarto with knitr engine is not yet supported." + else + assert_success + assert_output --partial "Test Deployment... [OK]" + # test the deployment via api + GUID="$(echo "${output}" | \ + grep "Direct URL:" | \ + grep -o -E '[0-9a-f-]{36}')" + run curl --silent --show-error -L --max-redirs 0 --fail \ + -X GET \ + -H "Authorization: Key ${CONNECT_API_KEY}" "${CONNECT_SERVER}/__api__/v1/content/${GUID}" + assert_output --partial "\"app_mode\":\"${CONTENT_TYPE}\"" + fi +} + +# temporary unsupported quarto types +quarto_r_content=( + "quarto-proj-r-shiny" "quarto-proj-r" "quarto-proj-r-py" + "quarty-website-r" "quarto-website-r-py" + "quarto-website-r-py-separate-files-deps" "quarto-website-r-deps" + "quarto-website-r-py-deps" + ) + # deploy content with the env account @test "deploy ${CONTENT}" { run ${EXE} deploy ${CONTENT_PATH}/${CONTENT} -n ci_deploy - assert_success - assert_output --partial "Test Deployment... [OK]" - # now test the deployment via api - GUID="$(echo "${output}" | \ - grep "Direct URL:" | \ - grep -o -E '[0-9a-f-]{36}')" - run curl --silent --show-error -L --max-redirs 0 --fail \ - -X GET \ - -H "Authorization: Key ${CONNECT_API_KEY}" "${CONNECT_SERVER}/__api__/v1/content/${GUID}" - assert_output --partial "\"app_mode\":\"${CONTENT_TYPE}\"" + deploy_assertion } # redeploy content from previous test @test "redeploy ${CONTENT}" { run ${EXE} redeploy ci_deploy ${CONTENT_PATH}${CONTENT} - assert_success - assert_output --partial "Test Deployment... [OK]" - # now test the deployment via api - GUID="$(echo "${output}" | \ - grep "Direct URL:" | \ - grep -o -E '[0-9a-f-]{36}')" - run curl --silent --show-error -L --max-redirs 0 --fail \ - -X GET \ - -H "Authorization: Key ${CONNECT_API_KEY}" "${CONNECT_SERVER}/__api__/v1/content/${GUID}" - assert_output --partial "\"app_mode\":\"${CONTENT_TYPE}\"" + deploy_assertion + # cleanup run rm -rf ${CONTENT_PATH}${CONTENT}/.posit/ ${CONTENT_PATH}${CONTENT}/.positignore } diff --git a/test/setup/connect_setup.py b/test/setup/connect_setup.py index 78d03ff75..9795b4ca2 100644 --- a/test/setup/connect_setup.py +++ b/test/setup/connect_setup.py @@ -7,7 +7,7 @@ import os # use the perftest fuzzbucket instance since it already has all the deps -alias = "ubuntu22-publishing-client" +alias = "ubuntu22-publishing-client-2024.02" box_name = "connect-publishing-client" list_command = "fuzzbucket-client -j list" create_command = "fuzzbucket-client create -c -S 20 -t m5.2xlarge " + alias + " -n " + box_name @@ -87,4 +87,4 @@ def connect_ready(box_name, max_attempts, interval): if response: print("http://" + get_ip(box_name) + ":3939") else: - print("Server did not respond after multiple attempts.") \ No newline at end of file + print("Server did not respond after multiple attempts.")