Skip to content

Commit

Permalink
Adding framework for testing extension
Browse files Browse the repository at this point in the history
- Adding scaffolding for tests
- Updated CD/CI GitHub actions for testing in multiple environments
  • Loading branch information
michaeljolley authored Mar 11, 2021
1 parent fe220fe commit 6e5cddc
Show file tree
Hide file tree
Showing 47 changed files with 4,235 additions and 314 deletions.
30 changes: 17 additions & 13 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{
"extends": [
"prettier"
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"rules": {
"no-use-before-define": "off",
"linebreak-style": "off"
},
"globals": {
"localStorage": false,
"window": false,
"Audio": false,
"io": false,
"$": false,
"document": false
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"semi": [
2,
"always"
],
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-non-null-assertion": 0
}
}
12 changes: 2 additions & 10 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
name: CD

on:
push:
branches: [ main ]
release:
types: [ published ]
jobs:
build:
if: github.event.head_commit.committer.name != 'Versioning Action'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- uses: tool3/bump@master
id: bump
with:
github_token: ${{ secrets.REPO_ACCESS_TOKEN }}
user: 'Versioning Action'
email: 'versioning@github.com'
branch: 'main'
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main, dev ]
jobs:
build:
if: github.event.head_commit.committer.name != 'Versioning Action'
runs-on: ubuntu-latest
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- name: Install dependencies
run: |
npm install
- name: Build extension
run: |
npm run compile
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 10.x
- run: npm install
- run: npm run lint
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
- run: npm test
if: runner.os != 'Linux'
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ out
node_modules
.vscode-test/
*.vsix
.env
.vscode/settings.json
dist
package-lock.json
.DS_Store
test/workspace/.vscode
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

12 changes: 5 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,23 @@
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: webpack"
"preLaunchTask": "npm: watch"
},
{
"name": "Extension Tests",
"name": "Run Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceFolder}/testworkspace",
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: test-compile"
"preLaunchTask": "npm: watch"
}
]
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Adding unit tests for existing extension capabilities
- CI process now confirms all tests pass on Linux, macOS, and Windows

---

## [0.0.10] - 2021-03-08
Expand Down
16 changes: 2 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,11 @@ For a contribution to be accepted:
If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the Issue. You can still
continue to add more commits to the branch you have sent the Pull Request from.

## Branching / Processes

We maintain two primary branches:

- `main`: Code that correlates to the latest released version of the extension
- `dev`: Code that is pending release to the Visual Studio Code marketplace

When submitting pull requests, be sure to create your development branch and submit pull requests targeting the
`dev` branch. Merged pull requests will live here until the maintainers merge them to the `main` branch
for an official release.

## How To

1. Fork this repository on GitHub.
1. Clone/fetch your fork to your local development machine.
1. Check out and pull the `dev` branch.
1. Create a new branch (e.g. `issue-12`, `feat.add_foo`, etc) and check it out.
1. Make your changes and commit them. (Did the tests pass?)
1. Make your changes and commit them. (Did the tests pass? No linting errors?)
1. Push your new branch to your fork. (e.g. `git push myname issue-12`)
1. Open a Pull Request from your new branch to the original fork's `dev` branch.
1. Open a Pull Request from your new branch to the original fork's `main` branch.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vonage for Visual Studio Code

[![Marketplace](https://vsmarketplacebadge.apphb.com/version/Vonage.vscode.svg?color=blue&style=?style=for-the-badge&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=Vonage.vscode) [![Installs](https://vsmarketplacebadge.apphb.com/installs-short/Vonage.vscode.svg?color=blue&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=Vonage.vscode) [![MIT](https://img.shields.io/badge/license-MIT-orange.svg?color=orange&style=flat-square)](https://opensource.org/licenses/MIT)
[![Marketplace](https://vsmarketplacebadge.apphb.com/version/Vonage.vscode.svg?color=blue?style=for-the-badge&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=Vonage.vscode) [![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/Vonage.vscode?color=%23ff00ff&logo=Vonage)](https://marketplace.visualstudio.com/items?itemName=Vonage.vscode) [![MIT](https://img.shields.io/badge/license-MIT-orange.svg?color=%2300ffff)](https://opensource.org/licenses/MIT)

A Visual Studio Code extension for accessing the Vonage communication APIs.

Expand Down
Loading

0 comments on commit 6e5cddc

Please sign in to comment.