From 074f4d908ce0d8baa9589f8e6efbb98cc5149c2f Mon Sep 17 00:00:00 2001 From: Jon Vanausdeln Date: Fri, 5 Jul 2024 08:16:50 -0700 Subject: [PATCH] Smoke Test: Add R dependencies (#3860) ### Intent Addresses #3844 Switches workflow to use a single source of truth for R dependencies from the qa-example-content repo. ### Approach Updated Github action to install R dependencies from DESCRIPTION file. Updated README with new instructions. ### QA Notes Smoke tests pass using new method. --- .github/workflows/positron-full-test.yml | 4 +++- test/smoke/README.md | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/positron-full-test.yml b/.github/workflows/positron-full-test.yml index 34cf87823a5..ff4a041ee18 100644 --- a/.github/workflows/positron-full-test.yml +++ b/.github/workflows/positron-full-test.yml @@ -31,7 +31,8 @@ jobs: run: | curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-"$(arch)"-latest.tar.gz | $(which sudo) tar xz -C /usr/local rig add 4.4.0 - Rscript -e "install.packages(c('arrow', 'connections', 'RSQLite', 'readxl', 'lubridate'))" + curl https://raw.githubusercontent.com/posit-dev/qa-example-content/main/DESCRIPTION --output DESCRIPTION + Rscript -e "pak::local_install_dev_deps(ask = FALSE)" - uses: actions/setup-node@v3 with: @@ -119,6 +120,7 @@ jobs: - name: Set TestRail Run Title id: set-testrail-run-title + if: always() run: echo "TESTRAIL_TITLE=$(date +'%Y-%m-%d') Smoke Tests" >> $GITHUB_ENV - name: Upload Test Results to TestRail diff --git a/test/smoke/README.md b/test/smoke/README.md index cdcfff8a96d..cb2ad181713 100644 --- a/test/smoke/README.md +++ b/test/smoke/README.md @@ -138,7 +138,8 @@ python -m pip install matplotlib ipykernel The current commands for R packages: ``` -Rscript -e "install.packages(c('arrow', 'connections', 'RSQLite', 'readxl', 'lubridate'))" +curl https://raw.githubusercontent.com/posit-dev/qa-example-content/main/DESCRIPTION --output DESCRIPTION +Rscript -e "pak::local_install_dev_deps(ask = FALSE)" ``` ## Build step @@ -158,6 +159,8 @@ Before any of the tests start executing the test framework clones down the [QA C For Python, add any package requirements to the `requirements.txt` file in the root of the [QA Content Examples](https://github.com/posit-dev/qa-example-content) repo. We generally do NOT pin them to a specific version, as test can be run against different versions of python and conflicts could arise. If this becomes a problem, we can revisit this mechanism. +For R, add any package requirements to the "imports" section of the `DESCRIPTION` file in the root of the [QA Content Examples](https://github.com/posit-dev/qa-example-content) repo. + ## Running tests Once you have the build watcher running you can run the smoke tests with the debug action `Launch Smoke Test`. (It's near the bottom of the debug dropdown.)