Skip to content

Commit

Permalink
feat: inital keploy vscode extension version (keploy#5)
Browse files Browse the repository at this point in the history
* V2.1.0 release:Added Tests, CI workflow for releases and testing, Bug fixes

Signed-off-by: Akash Singh <[email protected]>

---

Signed-off-by: Akash Singh <[email protected]>
Co-authored-by: Animesh Pathak <[email protected]>
  • Loading branch information
SkySingh04 and Sonichigo authored Jul 19, 2024
1 parent e72d7c0 commit 1d58593
Show file tree
Hide file tree
Showing 88 changed files with 37,110 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": [ "camelCase", "PascalCase" ]
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/** linguist-vendored
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish Extension

on:
workflow_run:
workflows: ["Test VsCode Extension"]
types:
- completed

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
skipDuplicate: true
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Release

on:
workflow_run:
workflows: ["Test VsCode Extension"]
types:
- completed

jobs:
package:
name: Package
runs-on: ubuntu-latest
outputs:
packageName: ${{ steps.setup.outputs.packageName }}
tag: ${{ steps.setup-tag.outputs.tag }}
version: ${{ steps.setup-tag.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ steps.node_version.outputs.nvmrc }}

- name: Install dependencies
run: npm i

- name: Install vsce
run: npm install -g @vscode/vsce

- name: Setup package path
id: setup
run: echo "::set-output name=packageName::$(node -e "console.log(require('./package.json').name + '-' + require('./package.json').version + '.vsix')")"

- name: Package
env:
VSIX_PACKAGE_PATH: ${{ steps.setup.outputs.packageName }}
run: vsce package

- uses: actions/upload-artifact@v2
with:
name: ${{ steps.setup.outputs.packageName }}
path: ${{ steps.setup.outputs.packageName }}

- name: Setup tag
id: setup-tag
run: |
version=$(node -p "require('./package.json').version")
majorVersion=$(echo $version | cut -d '.' -f 1)
echo "tag: release/$majorVersion"
echo "::set-output name=tag::release/$majorVersion"
echo "::set-output name=version::$version"
shell: bash

publishGH:
name: Publish to GitHub releases
runs-on: ubuntu-latest
needs: package
if: startsWith(needs.package.outputs.tag, 'release/') && needs.package.outputs.tag != github.ref
steps:
- uses: actions/download-artifact@v2
with:
name: ${{ needs.package.outputs.packageName }}

- name: Commit tagger
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.package.outputs.tag }}

- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.package.outputs.tag }}
release_name: Release ${{ needs.package.outputs.version }}
draft: false
prerelease: false

- name: Upload assets to a Release
uses: AButler/[email protected]
with:
files: ${{ needs.package.outputs.packageName }}
release-tag: ${{ needs.package.outputs.tag }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test VsCode Extension

on:
push:
branches:
- master

jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 18.x

- run: npm install

- run: xvfb-run -a npm test
if: runner.os == 'Linux'

- run: npm test
if: runner.os != 'Linux'
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
node_modules
.vscode-test/
intellijpublish.yml
*.log
5 changes: 5 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
});
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"ms-vscode.extension-test-runner"
]
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
14 changes: 14 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.vscode/**
.vscode-test/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
**/.vscode-test.*
!src/*
!.vscodeignore
!.out/*
!.scripts/*
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Change Log

All notable changes to the "Keploy" extension will be documented in this file.


## [1.0.0]

First Release for Vs Code Extension.

- Record and Replay tests.
- Support for GO, Java, Python, Node.
- Previous TestRun History, available.
- View and Edit Keploy Config File.
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# vscode-extension
Keploy VsCode Extension
# Keploy VS Code Extension

Keploy is a Visual Studio Code extension designed to help developers record and replay test cases directly within the IDE.

> Note: This extension currently supports only Go, Node, Python and Java programming language.
## Features

### Record and Replay TestCases.
### View Previous TestRun Result.
### View and Edit Keploy Config File


## Installation

1. Install the Keploy extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/).

2. Keploy CLI is present : - `curl --silent -O -L https://keploy.io/install.sh && source install.sh`


## Contirbution Guide

### Start in development mode

1. Press `F5` to open a new window with your extension loaded.
2. Set breakpoints in your code inside `src/extension.ts` to debug your extension.
3. From the debug console, you can see the output or errors if any.

### Make

1. You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`.

2. You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.

3. `package.json` - this is the manifest file in which you declare your extension and command.
* The sample plugin registers a command and defines its title and command name. With this information VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.

4. `src/extension.ts` - this is the main file where you will provide the implementation of your command.
* The file exports one function, `activate`, which is called the very first time your extension is activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.

* We pass the function containing the implementation of the command as the second parameter to `registerCommand`.
1 change: 1 addition & 0 deletions media/Animation .json

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions media/copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1d58593

Please sign in to comment.