pull/2455/head
Alexandru Dima 4 years ago
parent 14c560f898
commit 1cada068d1
No known key found for this signature in database
GPG Key ID: 6E58D7B045760DA0

@ -1,84 +0,0 @@
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 8 * * *'
jobs:
build:
name: Smoke Test
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: microsoft/playwright-github-action@v1
- uses: actions/setup-node@v2
with:
node-version: 12
- name: Checkout VS Code
run: git clone --depth 1 https://github.com/microsoft/vscode vscode
- name: Compute VS Code node modules cache key
id: nodeModulesCacheKey
working-directory: ./vscode
run: echo "::set-output name=value::$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js)"
- name: Cache VS Code node modules
id: cacheNodeModules
uses: actions/cache@v2
with:
path: "vscode/**/node_modules"
key: ${{ runner.os }}-cacheNodeModules-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-cacheNodeModules-
- name: Get yarn cache directory path
id: yarnCacheDirPath
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn directory
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
uses: actions/cache@v2
with:
path: ${{ steps.yarnCacheDirPath.outputs.dir }}
key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-yarnCacheDir-
- name: Execute yarn
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
working-directory: ./vscode
run: yarn --frozen-lockfile --network-timeout 180000
- name: Editor Distro
working-directory: ./vscode
run: |
yarn gulp editor-distro
- name: NPM Install
run: npm install
- name: Webpack Bundle
run: |
npm run bundle
- name: Build Tests
run: npm run build-test
- name: Run Smoke Test
run: |
npm run ciserver &
sleep 10
BROWSER=chromium npm run test
BROWSER=firefox npm run test
BROWSER=webkit npm run test

@ -1,25 +0,0 @@
import * as monaco from 'monaco-editor-core';
self.MonacoEnvironment = {
getWorkerUrl: function (moduleId, label) {
return './editor.worker.bundle.js';
}
}
window.instance = monaco.editor.create(document.getElementById('container'), {
value: [
'from banana import *',
'',
'class Monkey:',
' # Bananas the monkey can eat.',
' capacity = 10',
' def eat(self, N):',
' \'\'\'Make the monkey eat N bananas!\'\'\'',
' capacity = capacity - N*banana.size',
'',
' def feeding_frenzy(self):',
' eat(9.25)',
' return "Yum yum"',
].join('\n'),
language: 'python'
});

@ -1,137 +0,0 @@
import * as playwright from 'playwright';
import { assert } from 'chai';
const APP = 'http://127.0.0.1:8080/dist/core.html';
let browser: playwright.Browser;
let page: playwright.Page;
type BrowserType = "chromium" | "firefox" | "webkit"
const browserType: BrowserType = process.env.BROWSER as BrowserType || "chromium"
before(async function () {
this.timeout(5 * 1000);
console.log(`Starting browser: ${browserType}`)
browser = await playwright[browserType].launch({
headless: process.argv.includes('--headless'),
});
});
after(async function () {
this.timeout(5 * 1000);
await browser.close();
});
beforeEach(async function () {
this.timeout(5 * 1000)
page = await browser.newPage({
viewport: {
width: 800,
height: 600
}
});
});
afterEach(async () => {
await page.close();
});
describe('Basic loading', function (): void {
this.timeout(20000);
it('should fail because page has an error', async () => {
const pageErrors: any[] = [];
page.on('pageerror', (e) => {
console.log(e);
pageErrors.push(e);
});
page.on('pageerror', (e) => {
console.log(e);
pageErrors.push(e);
});
await page.goto(APP);
this.timeout(20000);
for (const e of pageErrors) {
throw e;
}
});
});
describe('API Integration Tests', function (): void {
this.timeout(20000);
beforeEach(async () => {
await page.goto(APP);
});
it('Default initialization should be error-less', async function (): Promise<any> {
assert.equal(await page.evaluate(`monaco.editor.DefaultEndOfLine[1]`), 'LF');
});
it('Focus and Type', async function (): Promise<any> {
await page.evaluate(`
(function () {
instance.focus();
instance.trigger('keyboard', 'cursorHome');
instance.trigger('keyboard', 'type', {
text: 'a'
});
})()
`);
assert.equal(await page.evaluate(`instance.getModel().getLineContent(1)`), 'afrom banana import *');
});
it('Type and Undo', async function (): Promise<any> {
await page.evaluate(`
(function () {
instance.focus();
instance.trigger('keyboard', 'cursorHome');
instance.trigger('keyboard', 'type', {
text: 'a'
});
instance.getModel().undo();
})()
`);
assert.equal(await page.evaluate(`instance.getModel().getLineContent(1)`), 'from banana import *');
});
it('Multi Cursor', async function (): Promise<any> {
await page.evaluate(`
(function () {
instance.focus();
instance.trigger('keyboard', 'editor.action.insertCursorBelow');
instance.trigger('keyboard', 'editor.action.insertCursorBelow');
instance.trigger('keyboard', 'editor.action.insertCursorBelow');
instance.trigger('keyboard', 'editor.action.insertCursorBelow');
instance.trigger('keyboard', 'editor.action.insertCursorBelow');
instance.trigger('keyboard', 'type', {
text: '# '
});
instance.focus();
})()
`);
await page.waitForTimeout(1000);
assert.deepEqual(await page.evaluate(`
[
instance.getModel().getLineContent(1),
instance.getModel().getLineContent(2),
instance.getModel().getLineContent(3),
instance.getModel().getLineContent(4),
instance.getModel().getLineContent(5),
instance.getModel().getLineContent(6),
instance.getModel().getLineContent(7),
]
`), [
'# from banana import *',
'# ',
'# class Monkey:',
'# # Bananas the monkey can eat.',
'# capacity = 10',
'# def eat(self, N):',
'\t\t\'\'\'Make the monkey eat N bananas!\'\'\''
]);
});
});

@ -1,18 +0,0 @@
{
"compilerOptions": {
"lib": [
"dom",
"es6",
],
"rootDir": ".",
"outDir": "../out-ci/",
"types": [
"../node_modules/@types/mocha",
"../node_modules/@types/node"
],
"sourceMap": true,
"removeComments": true,
"pretty": true,
"strict": true
}
}

15
dist/core.html vendored

@ -1,15 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<div id="container" style="width:800px;height:600px;border:1px solid #ccc"></div>
<script src="./core.bundle.js"></script>
</body>
</html>

@ -824,8 +824,3 @@ gulp.task('simpleserver', taskSeries(generateTestSamplesTask, function() {
createSimpleServer(SERVER_ROOT, 8080);
createSimpleServer(SERVER_ROOT, 8088);
}));
gulp.task('ciserver', taskSeries(generateTestSamplesTask, function () {
const SERVER_ROOT = path.normalize(path.join(__dirname, './'));
createSimpleServer(SERVER_ROOT, 8080);
}));

2271
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -9,11 +9,7 @@
"simpleserver": "gulp simpleserver",
"release": "gulp release",
"website": "gulp website",
"build-website": "gulp build-website",
"build-test": "tsc -b ./ci/tsconfig.json --preserveWatchOutput",
"bundle": "webpack --config ci/webpack.config.js --bail",
"test": "mocha \"out-ci/*.test.js\" --headless",
"ciserver": "gulp ciserver"
"build-website": "gulp build-website"
},
"typings": "./esm/vs/editor/editor.api.d.ts",
"module": "./esm/vs/editor/editor.main.js",
@ -22,31 +18,20 @@
"url": "https://github.com/Microsoft/monaco-editor"
},
"devDependencies": {
"@types/chai": "^4.2.12",
"@types/mocha": "^8.0.3",
"chai": "^4.2.0",
"clean-css": "^4.2.3",
"css-loader": "^5.0.1",
"event-stream": "4.0.1",
"file-loader": "^6.2.0",
"gulp": "^4.0.2",
"gulp-typedoc": "^2.2.5",
"mocha": "^8.1.3",
"monaco-css": "3.1.1",
"monaco-editor-core": "0.21.2",
"monaco-html": "3.1.1",
"monaco-json": "3.2.1",
"monaco-languages": "2.1.1",
"monaco-typescript": "4.1.1",
"playwright": "1.3.0",
"rimraf": "^3.0.2",
"style-loader": "^2.0.0",
"typedoc": "^0.19.1",
"typescript": "^4.0.3",
"uncss": "^0.17.3",
"vinyl": "^2.2.1",
"webpack": "^5.11.0",
"webpack-cli": "^4.3.0",
"yaserver": "^0.3.0"
}
}

Loading…
Cancel
Save