-
Notifications
You must be signed in to change notification settings - Fork 0
[feature/9] resolves #9: Added Tests #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "commitPrefix": "[{{branch}}] resolves #{{ticket}}: ", | ||
| "requireTests": "disabled" | ||
| "requireTests": "prevent" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "prefix": "{{ticket}}", | ||
| "requireTests": "prevent" | ||
| } |
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,133 @@ | |||||||||||||||||||||||||||||
| name: CI Build and Test | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||
| push: | |||||||||||||||||||||||||||||
| branches: [ main, dev ] | |||||||||||||||||||||||||||||
| pull_request: | |||||||||||||||||||||||||||||
| branches: [ main, dev ] | |||||||||||||||||||||||||||||
| workflow_dispatch: | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||
| build: | |||||||||||||||||||||||||||||
| name: Build and Test | |||||||||||||||||||||||||||||
| runs-on: ${{ matrix.os }} | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| strategy: | |||||||||||||||||||||||||||||
| matrix: | |||||||||||||||||||||||||||||
| os: [ubuntu-latest, windows-latest, macos-latest] | |||||||||||||||||||||||||||||
| node-version: [18.x, 20.x] | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout code | |||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Node.js ${{ matrix.node-version }} | |||||||||||||||||||||||||||||
| uses: actions/setup-node@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| node-version: ${{ matrix.node-version }} | |||||||||||||||||||||||||||||
| cache: 'npm' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install dependencies | |||||||||||||||||||||||||||||
| run: npm ci | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Lint code | |||||||||||||||||||||||||||||
| run: npm run lint | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Compile TypeScript | |||||||||||||||||||||||||||||
| run: npm run compile | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Run build test | |||||||||||||||||||||||||||||
| run: npm run test:build | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Package extension | |||||||||||||||||||||||||||||
| run: npx @vscode/vsce package | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Upload VSIX artifact | |||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v4 | |||||||||||||||||||||||||||||
| if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x' | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| name: git-quickops-vsix | |||||||||||||||||||||||||||||
| path: '*.vsix' | |||||||||||||||||||||||||||||
| retention-days: 7 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Run integration tests (Ubuntu) | |||||||||||||||||||||||||||||
| if: runner.os == 'Linux' | |||||||||||||||||||||||||||||
| run: xvfb-run -a npm run test:integration | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Run integration tests (macOS) | |||||||||||||||||||||||||||||
| if: runner.os == 'macOS' | |||||||||||||||||||||||||||||
| run: npm run test:integration | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Run integration tests (Windows) | |||||||||||||||||||||||||||||
| if: runner.os == 'Windows' | |||||||||||||||||||||||||||||
| run: npm run test:integration | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| lint-check: | |||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+65
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 1 day ago In general, to fix this issue you should explicitly set For this specific workflow, none of the jobs ( Concretely:
No extra imports or methods are needed; this is purely a YAML configuration change.
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||
| name: Lint and Format Check | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout code | |||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Node.js | |||||||||||||||||||||||||||||
| uses: actions/setup-node@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| node-version: '20.x' | |||||||||||||||||||||||||||||
| cache: 'npm' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install dependencies | |||||||||||||||||||||||||||||
| run: npm ci | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Run ESLint | |||||||||||||||||||||||||||||
| run: npm run lint | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Check TypeScript compilation | |||||||||||||||||||||||||||||
| run: npm run compile | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| validate-package: | |||||||||||||||||||||||||||||
|
Comment on lines
+66
to
+88
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 1 day ago In general, the fix is to explicitly restrict The single best fix here is to add a root-level Concretely, in permissions:
contents: readThis ensures that the
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||
| name: Validate Package | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout code | |||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup Node.js | |||||||||||||||||||||||||||||
| uses: actions/setup-node@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| node-version: '20.x' | |||||||||||||||||||||||||||||
| cache: 'npm' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install dependencies | |||||||||||||||||||||||||||||
| run: npm ci | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Validate package.json | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| node -e "const pkg = require('./package.json'); console.log('Package validation passed');" | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Check for missing fields | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| node -e " | |||||||||||||||||||||||||||||
| const pkg = require('./package.json'); | |||||||||||||||||||||||||||||
| const required = ['name', 'displayName', 'version', 'publisher', 'engines', 'categories', 'main']; | |||||||||||||||||||||||||||||
| const missing = required.filter(f => !pkg[f]); | |||||||||||||||||||||||||||||
| if (missing.length) { | |||||||||||||||||||||||||||||
| console.error('Missing required fields:', missing); | |||||||||||||||||||||||||||||
| process.exit(1); | |||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||
| console.log('All required fields present'); | |||||||||||||||||||||||||||||
| " | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Compile and package | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| npm run compile | |||||||||||||||||||||||||||||
| npx @vscode/vsce package --no-dependencies | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Verify VSIX creation | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| if [ ! -f *.vsix ]; then | |||||||||||||||||||||||||||||
| echo "VSIX file was not created" | |||||||||||||||||||||||||||||
| exit 1 | |||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||
| echo "VSIX file created successfully" | |||||||||||||||||||||||||||||
|
Comment on lines
+89
to
+133
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 1 day ago In general, the fix is to explicitly declare a The best fix, without changing functionality, is to add a single top-level Concretely:
No additional methods, imports, or definitions are needed, and no steps need modification.
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "require": ["source-map-support/register"], | ||
| "ui": "tdd", | ||
| "color": true, | ||
| "timeout": 10000, | ||
| "slow": 5000 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (performance): Reduce duplicate compilation work in CI by reusing the existing compile step.
This job already runs
npm run compile, andtest:buildalso callsnpm run compile, so each build compiles twice. Consider either removing the explicitCompile TypeScriptstep and relying ontest:build, or updatingtest:buildto assume compilation has already happened in CI and dropping its internalnpm run compile.