-
Notifications
You must be signed in to change notification settings - Fork 26
ci: use with-connect for integration testing against many versions of Connect #739
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
Changes from all commits
d4c335e
ecee0b6
afe8071
76bbb73
c12e7de
d622e1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,26 +15,26 @@ permissions: | |
| pull-requests: write | ||
|
|
||
| jobs: | ||
| test: | ||
| test-python-versions: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | ||
| include: | ||
| - os: macos-latest | ||
| python-version: '3.9' | ||
| python-version: '3.13' | ||
| - os: windows-latest | ||
| python-version: '3.9' | ||
| python-version: '3.13' | ||
| runs-on: ${{ matrix.os }} | ||
| name: test (py${{ matrix.python-version }} ${{ matrix.os }}) | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - uses: actions/setup-python@v4 | ||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - run: pip install '.[test]' | ||
|
|
@@ -52,12 +52,12 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - uses: actions/setup-python@v4 | ||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: 3.8.x | ||
| - run: pip install --pre '.[test]' | ||
|
|
@@ -67,18 +67,18 @@ jobs: | |
| - run: make test-3.8 | ||
|
|
||
| distributions: | ||
| needs: test | ||
| needs: test-python-versions | ||
| strategy: | ||
| matrix: | ||
| package_name: ["rsconnect_python", "rsconnect"] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - uses: actions/setup-python@v4 | ||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: 3.8.x | ||
| - name: Install uv # see scripts/temporary-rename | ||
|
|
@@ -103,10 +103,10 @@ jobs: | |
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
|
||
| docs: | ||
| needs: test | ||
| needs: test-python-versions | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| env: | ||
|
|
@@ -117,7 +117,7 @@ jobs: | |
| python-version: 3.12 | ||
| - name: build docs | ||
| run: make docs | ||
| - uses: actions/upload-artifact@v4 | ||
| - uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: docs | ||
| path: site/ | ||
|
|
@@ -136,12 +136,52 @@ jobs: | |
| - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
| run: make promote-docs-in-s3 | ||
|
|
||
| test-rsconnect: | ||
| name: "Integration tests against latest Connect" | ||
| test-connect-versions: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| version: | ||
| - "release" # special value that always points to the latest Connect release | ||
| - "2025.09.0" # jammy | ||
| - "2025.03.0" # jammy | ||
| - "2024.09.0" # jammy | ||
| - "2024.03.0" # jammy | ||
| - "2023.09.0" # jammy | ||
| - "2023.03.0" # bionic | ||
| - "2022.10.0" # bionic | ||
| name: Integration tests against Connect ${{ matrix.version }} | ||
| env: | ||
| python-version: 3.13 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe worth checking the last 2 or 3 versions of python here ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a separate matrix that tests across python versions. I'm not sure we need python versions x Connect versions here, these are just testing that we haven't done anything that breaks the Connect API contract. |
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ env.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install '.[test]' | ||
|
|
||
| - run: pip freeze | ||
|
|
||
| - run: rsconnect version | ||
|
|
||
| - name: Run integration tests | ||
| uses: posit-dev/with-connect@main | ||
| with: | ||
| version: ${{ matrix.version }} | ||
| # License file valid until 2026-12-05 | ||
| license: ${{ secrets.CONNECT_LICENSE_FILE }} | ||
| command: | | ||
| make test-${{ env.python-version }} | ||
|
|
||
| test-dev-connect: | ||
| name: "Integration tests against dev Connect" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v4 | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: 3.12.4 | ||
| - name: Install dependencies | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ | |
| optional_target, | ||
| require_api_key, | ||
| require_connect, | ||
| require_connect_version, | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -88,6 +89,7 @@ def test_ping_api_key(self): | |
| assert "OK" in result.output | ||
|
|
||
| def test_deploy(self): | ||
| require_connect_version("2025.03.0") | ||
| target = optional_target(get_dir(join("pip1", "dummy.ipynb"))) | ||
| runner = CliRunner() | ||
| args = self.create_deploy_args("notebook", target) | ||
|
|
@@ -290,6 +292,7 @@ def post_application_deploy_callback(request, uri, response_headers): | |
| os.environ["CONNECT_SERVER"] = original_server_value | ||
|
|
||
| # noinspection SpellCheckingInspection | ||
| @pytest.mark.skip(reason="Skipping R manifest test (requires R 3.5, docker containers have moved on).") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can this test just be removed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed or deleted, yeah. I made #741 to look into that. |
||
| def test_deploy_manifest(self): | ||
| target = optional_target(get_manifest_path("shinyapp")) | ||
| runner = CliRunner() | ||
|
|
@@ -299,7 +302,8 @@ def test_deploy_manifest(self): | |
|
|
||
| # noinspection SpellCheckingInspection | ||
| @httpretty.activate(verbose=True, allow_net_connect=False) | ||
| def test_deploy_manifest_shinyapps(self): | ||
| @mock.patch("rsconnect.api.webbrowser.open_new") | ||
| def test_deploy_manifest_shinyapps(self, mock_open_browser): | ||
| original_api_key_value = os.environ.pop("CONNECT_API_KEY", None) | ||
| original_server_value = os.environ.pop("CONNECT_SERVER", None) | ||
|
|
||
|
|
@@ -474,7 +478,8 @@ def post_deploy_callback(request, uri, response_headers): | |
| os.environ["CONNECT_SERVER"] = original_server_value | ||
|
|
||
| @httpretty.activate(verbose=True, allow_net_connect=False) | ||
| def test_redeploy_manifest_shinyapps(self): | ||
| @mock.patch("rsconnect.api.webbrowser.open_new") | ||
| def test_redeploy_manifest_shinyapps(self, mock_open_browser): | ||
| original_api_key_value = os.environ.pop("CONNECT_API_KEY", None) | ||
| original_server_value = os.environ.pop("CONNECT_SERVER", None) | ||
|
|
||
|
|
@@ -641,6 +646,7 @@ def post_deploy_callback(request, uri, response_headers): | |
| os.environ["CONNECT_SERVER"] = original_server_value | ||
|
|
||
| def test_deploy_api(self): | ||
| require_connect_version("2025.03.0") | ||
| target = optional_target(get_api_path("flask")) | ||
| runner = CliRunner() | ||
| args = self.create_deploy_args("api", target) | ||
|
|
@@ -656,6 +662,7 @@ def test_deploy_api_fail_verify(self): | |
| assert result.exit_code == 1, result.output | ||
|
|
||
| def test_deploy_api_fail_no_verify(self): | ||
| require_connect_version("2025.03.0") | ||
| target = optional_target(get_api_path("flask-bad")) | ||
| runner = CliRunner() | ||
| args = self.create_deploy_args("api", target) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| >=3.8 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| >=3.8 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": 1, | ||
| "metadata": {}, | ||
| "outputs": [ | ||
| { | ||
| "data": { | ||
| "text/plain": [ | ||
| "'this is a notebook'" | ||
| ] | ||
| }, | ||
| "execution_count": 1, | ||
| "metadata": {}, | ||
| "output_type": "execute_result" | ||
| } | ||
| ], | ||
| "source": [ | ||
| "\"this is a notebook\"" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [] | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "kernelspec": { | ||
| "display_name": "Python 3", | ||
| "language": "python", | ||
| "name": "python3" | ||
| }, | ||
| "language_info": { | ||
| "codemirror_mode": { | ||
| "name": "ipython", | ||
| "version": 3 | ||
| }, | ||
| "file_extension": ".py", | ||
| "mimetype": "text/x-python", | ||
| "name": "python", | ||
| "nbconvert_exporter": "python", | ||
| "pygments_lexer": "ipython3", | ||
| "version": "3.6.6" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 2 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| numpy | ||
| pandas | ||
| matplotlib |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| >=3.8 |
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.
missing 2025.10.0
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.
Intentionally so. I only have it testing every 6 months, same as on
connectapi. I don't think it's worth testing every single release in there.