Skip to content

Commit 2cc1fb2

Browse files
committed
tests for extractor and replacer
1 parent 44e72ac commit 2cc1fb2

16 files changed

Lines changed: 1610 additions & 4588 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: JS/TS Language Unit Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'codeflash/languages/javascript/**'
8+
- 'tests/test_languages/test_js_*.py'
9+
- 'tests/test_languages/fixtures/**'
10+
- 'packages/codeflash/**'
11+
pull_request:
12+
paths:
13+
- 'codeflash/languages/javascript/**'
14+
- 'tests/test_languages/test_js_*.py'
15+
- 'tests/test_languages/fixtures/**'
16+
- 'packages/codeflash/**'
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref_name }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
js-language-tests:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
python-version: ['3.11', '3.12']
29+
node-version: ['18', '20']
30+
fail-fast: false
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Set up Node.js ${{ matrix.node-version }}
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: ${{ matrix.node-version }}
43+
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: astral-sh/setup-uv@v6
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
49+
- name: Install Python dependencies
50+
run: uv sync
51+
52+
- name: Install codeflash npm package dependencies
53+
run: |
54+
cd packages/codeflash
55+
npm install
56+
57+
- name: Run JS/TS code extractor tests
58+
run: |
59+
uv run pytest tests/test_languages/test_js_code_extractor.py -v --tb=short
60+
61+
- name: Run JS/TS code replacer tests
62+
run: |
63+
uv run pytest tests/test_languages/test_js_code_replacer.py -v --tb=short
64+
65+
- name: Run JS multi-file replacer test
66+
run: |
67+
uv run pytest tests/test_languages/test_multi_file_code_replacer.py -v --tb=short

0 commit comments

Comments
 (0)