Skip to content

Commit

Permalink
Remove bats tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dotNomad committed Jan 28, 2025
1 parent eb1bfe0 commit cf57d94
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 582 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/bats.yaml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/contract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,73 +31,6 @@ jobs:
CONNECT_SERVER=$(python test/setup/get_ip.py)
echo "CONNECT_SERVER=$CONNECT_SERVER" >> $GITHUB_OUTPUT
bats-tests:
needs: get-connect-ip
if: ${{ github.event_name == 'schedule' || github.event.inputs.job == 'all' || github.event.inputs.job == 'bats-tests' }}
env:
FUZZBUCKET_SSH_KEY: ${{ secrets.FUZZBUCKET_SSH_KEY }}
FUZZBUCKET_URL: ${{ secrets.FUZZBUCKET_URL }}
FUZZBUCKET_CREDENTIALS: ${{ secrets.FUZZBUCKET_CREDENTIALS }}
CI: true
CONNECT_SERVER: ${{ needs.get-connect-ip.outputs.connect_ip }}
strategy:
fail-fast: false
matrix:
runs-on: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: python
uses: actions/setup-python@v5
with:
# use python 3.12 for bats
# there are some requirements that are not yet compatible with python 3.13
python-version: 3.12
- name: R
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.3.0
- name: quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.4.549

- uses: actions/download-artifact@v4
with:
name: bin
path: bin
- uses: actions/checkout@v4
with:
repository: rstudio/connect-content
path: "test/content"
sparse-checkout: bundles
sparse-checkout-cone-mode: false
token: ${{ secrets.CONNECT_PAT }}

- name: Install deps on ubuntu
run: |
sudo apt-get install libcurl4-openssl-dev libsodium-dev libfontconfig1-dev libfribidi-dev libfontconfig1-dev libpng-dev
R -e "install.packages('renv', repos='https://packagemanager.posit.co/cran/latest')"
if: matrix.runs-on == 'ubuntu-latest'
- name: Install deps on windows
run: |
R.exe -e "install.packages('renv', repos='https://packagemanager.posit.co/cran/latest')"
if: matrix.runs-on == 'windows-latest'
- name: Install deps on macos
run: |
R -e "install.packages('renv', repos='https://packagemanager.posit.co/cran/latest')"
if: matrix.runs-on == 'macos-latest'
- name: Run Bats Tests
run: |
chmod -R +x ./bin
just bats install
just bats test common
just bats test init
just bats test deploy
vscode-ui-tests:
needs: get-connect-ip
if: ${{ github.event_name == 'schedule' || github.event.inputs.job == 'all' || github.event.inputs.job == 'vscode-ui-tests' }}
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,3 @@ jobs:
- package
uses: ./.github/workflows/upload.yaml
secrets: inherit

# Integration Tests
bats:
needs: build
secrets: inherit
uses: ./.github/workflows/bats.yaml
1 change: 0 additions & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
type: choice
options:
- all
- bats-tests
- vscode-ui-tests
jobs:
agent:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ jobs:
uses: ./.github/workflows/upload.yaml
secrets: inherit

# Integration Tests
bats:
needs: build
secrets: inherit
uses: ./.github/workflows/bats.yaml

vscode-ui:
needs:
- build
Expand Down
8 changes: 0 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,6 @@ just cover

Once complete, a coverage report will open in your default browser.

### Integration Tests

The [Bats](https://bats-core.readthedocs.io/en/stable/) framework is used to perform integration tests. For this project we use Bats to assert integrations with native machines via the Bash shell.

```
just bats
```

## Development

### Build Tools
Expand Down
32 changes: 0 additions & 32 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,6 @@ The following tests can all be run at the project root directory.

Note: These tests assume no accounts exist and no deployments have been made against the test content, so you may need to clear any saved accounts or previous deployments prior to running.

## bats tests

We use bats to test different segments of the publisher client. There are several targets that initiate tests for different components.

### deploy

These tests will start a Connect instance in EC2, retrieve content from the [connect-content ](https://github.com/rstudio/connect-content)repository and deploy each item to Connect running a series of tests found in [deploy.bats](https://github.com/posit-dev/publisher/tree/main/test/bats/contract/deploy.bats).

### init

These tests will not require a Connect instance but will retrieve content from the [connect-content](https://github.com/rstudio/connect-content) repository and call `init` against each item and run the tests found in [init.bats](https://github.com/posit-dev/publisher/blob/main/test/bats/cli/init.bats).

### common

These tests will not require a Connect instance or content. They run tests found in [common.bats](https://github.com/posit-dev/publisher/blob/main/test/bats/cli/common.bats).

### Running the tests

To run the tests, from the project root directory run the following command(s).

You will need to install bats before running the tests initially, to do so run:

```
just bats install
```

Then you can run one of the above tests:

```
just bats test [test-case]
```

## vscode-ui tests

We use the [webdriver.io VSCode Extension Service ](https://webdriver.io/docs/extension-testing/vscode-extensions) to test the VSCode UI components. These tests do not require a Connect instance nor extraneous content as it uses the content from our [sample-content directory](https://github.com/posit-dev/publisher/tree/main/test/sample-content).
Expand Down
1 change: 0 additions & 1 deletion test/bats/.gitignore

This file was deleted.

115 changes: 0 additions & 115 deletions test/bats/cli/common.bats

This file was deleted.

62 changes: 0 additions & 62 deletions test/bats/cli/init.bats

This file was deleted.

Loading

0 comments on commit cf57d94

Please sign in to comment.