Skip to content

Commit

Permalink
Merge branch 'master' into fix/manifest-corruption-prevention
Browse files Browse the repository at this point in the history
  • Loading branch information
anandgupta42 authored Jan 22, 2025
2 parents 048e285 + 51c5cf4 commit ae6a1ca
Show file tree
Hide file tree
Showing 52 changed files with 12,576 additions and 4,467 deletions.
17 changes: 11 additions & 6 deletions .github/actions/common-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ runs:
uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm install
shell: bash # Explicitly define the shell
- run: npm install
shell: bash # Explicitly define the shell
cache: 'npm'
cache-dependency-path: |
package-lock.json
new_lineage_panel/package-lock.json
webview_panels/package-lock.json
- run: npm ci
shell: bash
- run: npm ci
shell: bash
working-directory: ./new_lineage_panel
- run: npm install
shell: bash # Explicitly define the shell
- run: npm ci
shell: bash
working-directory: ./webview_panels
- run: npm run postinstall
shell: bash
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Tests

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]

jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: |
package-lock.json
new_lineage_panel/package-lock.json
webview_panels/package-lock.json
- name: Install dependencies
run: |
npm ci
npm run install:panels
- name: Compile
run: npm run compile

- name: Install xvfb
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb
- name: Run tests (Linux)
if: runner.os == 'Linux'
run: |
xvfb-run --auto-servernum npm run compile && xvfb-run --auto-servernum npm run test:coverage
- name: Run tests (macOS/Windows)
if: runner.os != 'Linux'
run: |
npm run compile && npm run test:coverage
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.os }}
path: test-results/

- name: Upload coverage results
if: always()
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.os }}
path: |
coverage/
.nyc_output/
*.lcov
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/
flags: unittests
name: codecov-${{ matrix.os }}
fail_ci_if_error: false
29 changes: 28 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,32 @@ dist
.idea
.history
__pycache__/
*.pyc
*.pyo
*.pyd

src/lib/notebooks/
# Build and dependencies
src/lib/notebooks/
.nyc_output/
coverage/
test-results/
.venv/

# Test directories
test_dbt_project/
test-workspace/

# IDE and editor files
*.swp
*.swo
.vscode/
*.code-workspace

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
26 changes: 26 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"check-coverage": true,
"reporter": ["text", "lcov"],
"exclude": [
"coverage/**",
"packages/*/test/**",
"test/**",
"test{,-*}.{js,cjs,mjs,ts}",
"**/*{.,-}test.{js,cjs,mjs,ts}",
"**/__tests__/**",
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.{js,cjs,mjs,ts}",
"**/node_modules/**",
"dist/**",
"out/**",
"src/test/**",
"src/**/*.test.ts",
"src/test/suite/**"
],
"include": ["src/**/*.ts"],
"branches": 5,
"lines": 7,
"functions": 7,
"statements": 7
}
15 changes: 15 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
coverage:
status:
project:
default:
target: 10% # the required coverage value
threshold: 1% # the leniency in hitting the target
patch:
default:
target: 90%
threshold: 1%

ignore:
- "test/**/*" # ignore test files
- "out/**/*" # ignore compiled output
- "**/*.d.ts" # ignore type declaration files
21 changes: 21 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
roots: ["<rootDir>/src"],
testMatch: ["**/*.test.ts"],
transform: {
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "tsconfig.json" }],
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
setupFilesAfterEnv: ["<rootDir>/src/test/setup.ts"],
collectCoverageFrom: [
"src/**/*.{ts,tsx}",
"!src/test/**",
"!**/node_modules/**",
],
coverageDirectory: "coverage",
moduleNameMapper: {
"^vscode$": "<rootDir>/src/test/mock/vscode.ts",
"^@lib$": "<rootDir>/src/test/mock/lib.ts",
},
};
Loading

0 comments on commit ae6a1ca

Please sign in to comment.