Skip to content

Commit

Permalink
e2e-test: remove test/automation (#5882)
Browse files Browse the repository at this point in the history
To centralize all relevant e2e test code and enhance clarity, the e2e
test structure has been reorganized:
* Removed the `positron` prefix from all of our POMs, as all Microsoft
POMs have been removed so this is no longer needed.
 * Moved (most of) `test/automation` to `test/e2e/infra`.
* The one exception was moving `test/automation/src/positron` to
`test/e2e/pages`
 * Renamed `test/e2e/areas` to `test/e2e/tests`
 * Updated watcher, only need to watch `test/e2e` now

This is the new e2e dir structure:
```
test/
└── e2e/
    ├── infra/   <-- contains all the driver, browser, electron, etc files
    ├── pages/   <-- contains all the Positron POMs
    └── tests/   <-- duh. the tests
    
 note: test/automation and test/smoke no longer exist!!
 ```
**FYI**
Since the driver files have been moved into our own directory, I’ve removed all “Start/End Positron” comment snippets. There’s no need to worry about upstream merges anymore, as all of our code now resides within our own directory.

### QA Notes

Ran [Full Suite](https://github.com/posit-dev/positron/actions/runs/12641293443)
Ran [Tests against Release](https://github.com/posit-dev/positron/actions/runs/12640026921)

In next PR, will update the README
  • Loading branch information
midleman authored Jan 7, 2025
1 parent a37f160 commit be25a0f
Show file tree
Hide file tree
Showing 143 changed files with 3,226 additions and 6,551 deletions.
2 changes: 1 addition & 1 deletion .eslint-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
**/src/vs/base/test/common/filters.perf.data.js
**/src/vs/loader.js
**/test/unit/assert.js
**/test/automation/out/**
**/test/e2e/out/**
**/typings/**
**/src/react.js
**/src/react-dom.js
Expand Down
23 changes: 0 additions & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1111,36 +1111,13 @@
{
"target": "test/e2e/**",
"restrictions": [
"test/automation",
"test/e2e/**",
"@vscode/*",
"@parcel/*",
"@playwright/*",
"*" // node modules
]
},
{
"target": "test/smoke/**",
"restrictions": [
"test/automation",
"test/smoke/**",
"@vscode/*",
"@parcel/*",
"@playwright/*",
"*" // node modules
]
},
{
"target": "test/automation/**",
"restrictions": [
"test/automation/**",
"@vscode/*",
"@parcel/*",
"playwright-core/**",
"@playwright/*",
"*" // node modules
]
},
{
"target": "test/integration/**",
"restrictions": [
Expand Down
1 change: 0 additions & 1 deletion .github/actions/setup-build-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ runs:
# Perform the main npm command; this installs all Node packages and
# dependencies
npm ci --fetch-timeout 120000
npm --prefix test/automation ci
npm --prefix test/e2e ci
- name: Compile and Download
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-test-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
steps:
- name: Compile E2E Tests
shell: bash
run: npm --prefix test/automation run compile && npm --prefix test/e2e run compile
run: npm --prefix test/e2e run compile

- name: Setup AWS S3 Access
uses: aws-actions/configure-aws-credentials@v4
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test-e2e-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
options:
- failure
- always
- never

permissions:
id-token: write
Expand Down Expand Up @@ -45,9 +46,7 @@ jobs:
- name: Compile tests
run: |
npm install
npm --prefix test/automation install
npm --prefix test/e2e install
npm --prefix test/automation run compile
npm --prefix test/e2e run compile
- name: Get & install latest release
Expand Down Expand Up @@ -111,10 +110,14 @@ jobs:
needs: [e2e-electron]
runs-on: ubuntu-latest
if: always()
env:
notify_on: ${{ github.event_name == 'schedule' && 'always' || inputs.notify_on || 'failure' }}
steps:
- run: |
echo "Will notify on: ${{ env.notify_on }}"
- name: Notify Slack
uses: midleman/slack-workflow-status@master
with:
repo_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_webhook_url: ${{ secrets.SLACK_TEST_RESULTS_WEBHOOK_URL }}
notify_on: ${{ inputs.notify_on }}
notify_on: ${{ env.notify_on }}
2 changes: 0 additions & 2 deletions .github/workflows/test-e2e-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,13 @@ jobs:
run: |
corepack enable
.\scripts\run-with-retry.ps1 -maxAttempts 3 -command "npm install --fetch-timeout 120000"
npm --prefix test/automation ci
npm --prefix test/e2e ci
- name: Compile and Download
run: npm exec -- npm-run-all --max-old-space-size=4095 -lp compile "electron x64" playwright-install download-builtin-extensions

- name: Compile E2E Tests
run: |
npm --prefix test/automation run compile
npm --prefix test/e2e run compile
- name: Install python dependencies
Expand Down
4 changes: 0 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
"extensions/**/dist/**": true,
"extensions/**/out/**": true,
"test/e2e/out/**": true,
"test/smoke/out/**": true,
"test/automation/out/**": true,
"test/integration/browser/out/**": true,
"src/vs/base/test/common/filters.perf.data.js": true,
"src/vs/base/test/node/uri.perf.data.txt": true,
Expand All @@ -51,8 +49,6 @@
"extensions/**/dist/**": true,
"extensions/**/out/**": true,
"test/e2e/out/**": true,
"test/smoke/out/**": true,
"test/automation/out/**": true,
"test/integration/browser/out/**": true
},
"files.readonlyExclude": {
Expand Down
2 changes: 0 additions & 2 deletions build/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ module.exports.indentationFilter = [
'!product.overrides.json',

// except specific folders
'!test/automation/out/**',
'!test/monaco/out/**',
'!test/smoke/out/**',
'!test/e2e/out/**',
'!extensions/typescript-language-features/test-workspace/**',
'!extensions/typescript-language-features/resources/walkthroughs/**',
Expand Down
5 changes: 2 additions & 3 deletions build/npm/dirs.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ const dirs = [
'remote/reh-web',
'test/integration/browser',
'test/monaco',
// no need to compile smoke tests during release builds
// 'test/automation',
// 'test/smoke',
// no need to compile e2e tests during release builds
// 'test/e2e',
// --- End Positron ---
'.vscode/extensions/vscode-selfhost-import-aid',
'.vscode/extensions/vscode-selfhost-test-provider',
Expand Down
12 changes: 0 additions & 12 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1271,25 +1271,13 @@ export default tseslint.config(
{
'target': 'test/e2e/**',
'restrictions': [
'test/automation',
'test/e2e/**',
'@vscode/*',
'@parcel/*',
'@playwright/*',
'*' // node modules
]
},
{
'target': 'test/automation/**',
'restrictions': [
'test/automation/**',
'@vscode/*',
'@parcel/*',
'playwright-core/**',
'@playwright/*',
'*' // node modules
]
},
{
'target': 'test/integration/**',
'restrictions': [
Expand Down
4 changes: 2 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
*--------------------------------------------------------------------------------------------*/

import { defineConfig } from '@playwright/test';
import { CustomTestOptions } from './test/e2e/areas/_test.setup';
import { CustomTestOptions } from './test/e2e/tests/_test.setup';
import type { GitHubActionOptions } from '@midleman/github-actions-reporter';
import { currentsReporter } from '@currents/playwright';

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig<CustomTestOptions>({
globalSetup: './test/e2e/areas/_global.setup.ts',
globalSetup: './test/e2e/tests/_global.setup.ts',
testDir: './test/e2e',
testIgnore: '**/example.test.ts',
testMatch: '*.test.ts',
Expand Down
2 changes: 1 addition & 1 deletion scripts/slack-skipped-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { execSync } = require('child_process');
const slackSkippedTests = (slackWebhookUrl) => {
try {
const skippedTests = execSync(
`grep -r --include \\*.test.ts -E "describe\\.skip|test\\.skip" test/e2e/areas | sed 's/\\.test\\.ts.*$/.test.ts/'`
`grep -r --include \\*.test.ts -E "describe\\.skip|test\\.skip" test/e2e/tests | sed 's/\\.test\\.ts.*$/.test.ts/'`
).toString();

const slackMessage = {
Expand Down
8 changes: 0 additions & 8 deletions test/automation/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions test/automation/.npmignore

This file was deleted.

3 changes: 0 additions & 3 deletions test/automation/README.md

This file was deleted.

Loading

0 comments on commit be25a0f

Please sign in to comment.