Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
Add JUnit 4 E2E tests for Code Lens (microsoft#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored Nov 13, 2019
1 parent 5e716ad commit 30c8cb6
Show file tree
Hide file tree
Showing 17 changed files with 1,160 additions and 24 deletions.
42 changes: 32 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
language: node_js
language: java

node_js:
- 'lts/*'
matrix:
include:
- os: linux
dist: trusty
jdk: openjdk8
- os: osx
osx_image: xcode9.3
jdk: oraclejdk8

os:
- linux
- osx
env:
- NODE_VERSION=12

branches:
only:
- master

before_install:
- |
Expand All @@ -17,12 +26,25 @@ before_install:
fi
install:
- npm install -g vsce
- nvm install $NODE_VERSION
- npm install

script:
- nvm use $NODE_VERSION
- npm run lint
- npm run build-plugin
- npm run compile
- vsce package
- npm test
- npm test

after_failure:
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
find $HOME/Library/Application\ Support/Code/User/workspaceStorage/*/redhat.java/jdt_ws/.metadata/.log -print -exec cat '{}' \;;
fi;
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
find $HOME/.config/Code/User/workspaceStorage/*/redhat.java/jdt_ws/.metadata/.log -print -exec cat '{}' \;;
fi;

addons:
apt:
packages:
- libsecret-1-dev
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"projectName": "com.microsoft.java.test.plugin",
},
{
"name": "Launch Tests",
"name": "Launch Tests (webpack)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" ],
"args": ["${workspaceFolder}/test/test-projects/", "--extensionDevelopmentPath=${workspaceFolder}", "--extensionTestsPath=${workspaceFolder}/dist/test/suite/index" ],
"sourceMaps": true,
"outFiles": [ "${workspaceFolder}/out/test/**/*.js" ],
"outFiles": [ "${workspaceFolder}/dist/**/*.js" ],
"preLaunchTask": "npm: compile"
}
]
Expand Down
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"maven.excludedFolders": [
"**/.*",
"**/node_modules",
"**/target",
"**/bin",
"**/test/test-projects"
]
}
4 changes: 3 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ package-lock.json
java-extension/**
gulpfile.js
resources/templates/scss/**
dist/**/*.map
dist/**/test
webpack.*.js
node_modules
*.log
demo
CONTRIBUTING.md
extension.bundle.ts
javaConfig.json
.github/**

# Ignore output of code sign
Expand Down
7 changes: 7 additions & 0 deletions extension.bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

export { activate, deactivate } from './src/extension';
export * from './src/codelens/TestCodeLensProvider';
export * from './src/runners/models';
export * from './src/testResultManager';
20 changes: 20 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });

const extension = require("./dist/extension.bundle");

async function activate(ctx) {
return await extension.activate(ctx);
}

async function deactivate(ctx) {
return await extension.deactivate(ctx);
}

// Export as entrypoints for vscode
exports.activate = activate;
exports.deactivate = deactivate;
Loading

0 comments on commit 30c8cb6

Please sign in to comment.