-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pw_ide: Add VSC end-to-end extension testing
Change-Id: Ibfef13be5b7e8cf5b374ce7d1a23df2a669835b7 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/260973 Presubmit-Verified: CQ Bot Account <[email protected]> Lint: Lint 🤖 <[email protected]> Reviewed-by: Chad Norvell <[email protected]> Docs-Not-Needed: Asad Memon <[email protected]> Commit-Queue: Asad Memon <[email protected]> Pigweed-Auto-Submit: Asad Memon <[email protected]>
- Loading branch information
Showing
10 changed files
with
180 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,7 @@ yarn-error.log | |
|
||
# pw_ide | ||
.pw_ide.user.yaml | ||
.vscode-test | ||
|
||
# Emboss | ||
*.emb.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2025 The Pigweed Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
// use this file except in compliance with the License. You may obtain a copy of | ||
// the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations under | ||
// the License. | ||
|
||
import { defineConfig } from '@vscode/test-cli'; | ||
import path from 'path'; | ||
|
||
export default defineConfig({ | ||
files: 'out/**/*.e2e.test.js', | ||
workspaceFolder: path.join(process.cwd(), '..', '..', '..'), | ||
mocha: { | ||
timeout: 60000 | ||
}, | ||
launchArgs: ['--install-extension', 'BazelBuild.vscode-bazel'] | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2025 The Pigweed Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
// use this file except in compliance with the License. You may obtain a copy of | ||
// the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations under | ||
// the License. | ||
|
||
import * as assert from 'assert'; | ||
import * as vscode from 'vscode'; | ||
import { initBazelClangdPath } from './clangd/bazel'; | ||
import { executeInTerminalAndGetStdout } from './terminal'; | ||
import { patchBazeliskIntoTerminalPath } from './terminal'; | ||
|
||
suite('Extension Test Suite', () => { | ||
vscode.window.showInformationMessage('Starting tests.'); | ||
test('Clang init', async () => { | ||
const success = await initBazelClangdPath(); | ||
assert.strictEqual(success, true); | ||
}); | ||
|
||
test('Bazel build test', async () => { | ||
await patchBazeliskIntoTerminalPath(); | ||
const output = await executeInTerminalAndGetStdout( | ||
'bazel build //pw_status', | ||
); | ||
assert.strictEqual( | ||
output.indexOf('Build completed successfully') > 0, | ||
true, | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2025 The Pigweed Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
// use this file except in compliance with the License. You may obtain a copy of | ||
// the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations under | ||
// the License. | ||
|
||
declare module 'node_modules-path'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es2020", | ||
"lib": [ | ||
"es2020" | ||
], | ||
"outDir": "out", | ||
"esModuleInterop": true, | ||
"sourceMap": true, | ||
"rootDir": ".", | ||
"strict": true, | ||
"types": [ | ||
"node", | ||
"mocha" | ||
], | ||
"typeRoots": [ | ||
"./node_modules/@types", | ||
"./src/types" | ||
] | ||
}, | ||
"include": [ | ||
"**/*.e2e.test.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
"strict": true | ||
}, | ||
"exclude": [ | ||
"*.js" | ||
"*.js", | ||
"**/*.e2e.test.ts" | ||
] | ||
} |