Skip to content

Commit 9957719

Browse files
committed
rearrange lfs
1 parent 61e17f4 commit 9957719

File tree

2 files changed

+48
-66
lines changed

2 files changed

+48
-66
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
**/expected_diff.txt filter=lfs diff=lfs merge=lfs -text
21
tests/integration/codemod/repos/extra/*.json filter=lfs diff=lfs merge=lfs -text
3-
**/expected_diff.patch filter=lfs diff=lfs merge=lfs -text
2+
**/test_codegen/expected_diff.patch filter=lfs diff=lfs merge=lfs -text
3+
**/test_codegen/expected_diff.patch.skip filter=lfs diff=lfs merge=lfs -text
44
tests/integration/codemod/repos/repos.json filter=lfs diff=lfs merge=lfs -text
55
tests/integration/verified_codemods/** filter=lfs diff=lfs merge=lfs -text
66
.github/disallowed-words.txt filter=lfs diff=lfs merge=lfs -text

.github/workflows/unit-tests.yml

Lines changed: 46 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -14,58 +14,31 @@ jobs:
1414
unit-tests:
1515
# changing the following value will significantly affect github's cost. Be careful and consult with the team before changing it.
1616
runs-on: ubuntu-latest-16
17-
# concurrency:
18-
# group: ${{ github.workflow }}-${{ github.ref }}
17+
strategy:
18+
matrix:
19+
shard: [1, 2, 3]
1920

2021
steps:
2122
- uses: actions/checkout@v4
2223
with:
2324
fetch-depth: 0
2425
- name: Setup backend
2526
uses: ./.github/actions/setup-backend
26-
# - name: Run ATS
27-
# uses: codecov/codecov-ats@v0.3.0
28-
# with:
29-
# static_token: ${{ secrets.CODECOV_STATIC_TOKEN }}
30-
# token: ${{ secrets.CODECOV_TOKEN }}
31-
# static_folder_to_search: src
32-
# static_folders_to_exclude: .venv
33-
# override_base_commit: ${{ github.event_name == 'push' && '' || github.event.pull_request.base.sha }}
34-
- name: Install pycoverage
35-
run: |
36-
pip install coverage
37-
- name: Create commit in codecov
38-
continue-on-error: true
27+
- name: Run ATS
28+
env:
29+
BASE_SHA: ${{github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before}}
30+
DEFAULT_TESTS: "tests/unit"
31+
CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}
32+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
33+
COLLECT_ARGS: "--timeout 50"
3934
run: |
4035
uv run codecovcli create-commit -t ${{ secrets.CODECOV_TOKEN }}
41-
- name: Create commit report in codecov
42-
continue-on-error: true
43-
run: |
4436
uv run codecovcli create-report -t ${{ secrets.CODECOV_TOKEN }}
45-
- name: Static Analysis
46-
continue-on-error: true
37+
bash ./.circleci/ats.sh
38+
- name: Run tests
4739
run: |
48-
uv run codecovcli static-analysis --token ${{ secrets.CODECOV_STATIC_TOKEN }} --folders-to-exclude .venv
49-
- name: Label Analysis
50-
continue-on-error: true
51-
run: |
52-
BASE_SHA=${{github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before}}
53-
response=$(uv run codecovcli label-analysis --token ${{ secrets.CODECOV_STATIC_TOKEN }} --base-sha=$BASE_SHA --dry-run --dry-run-format="json")
54-
# Create directory to put result files
55-
mkdir codecov_ats
56-
# Export tests to run and tests to skip into respective files
57-
jq <<< "$response" '.runner_options + .ats_tests_to_run | @sh' --raw-output > codecov_ats/tests_to_run.txt
58-
jq <<< "$response" '.runner_options + .ats_tests_to_skip | @sh' --raw-output > codecov_ats/tests_to_skip.txt
59-
# Statistics on the test selection
60-
testcount() { jq <<< "$response" ".$1 | length"; }
61-
run_count=$(testcount ats_tests_to_run)
62-
skip_count=$(testcount ats_tests_to_skip)
63-
echo "Run count: $run_count"
64-
echo "Skip count: $skip_count"
65-
- name: Test with pytest
66-
timeout-minutes: 6
67-
run: |
68-
uv run pytest --cov \
40+
TESTS_TO_RUN=$(cat codecov_ats/tests_to_run.txt)
41+
echo $TESTS_TO_RUN | xargs uv run pytest --cov \
6942
-o junit_suite_name="${{github.job}}" \
7043
-n auto \
7144
-vv \
@@ -74,6 +47,12 @@ jobs:
7447
--timeout 50 \
7548
--cov-report=xml \
7649
tests/unit
50+
- name: Upload test results to Codecov
51+
if: ${{ !cancelled() }}
52+
uses: codecov/test-results-action@v1
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
files: build/test-results/test/TEST.xml
7756
- name: Upload coverage reports to Codecov
7857
if: (success() || failure()) # always upload coverage reports even if the tests fail
7958
continue-on-error: true
@@ -83,12 +62,6 @@ jobs:
8362
files: coverage.xml
8463
flags: smart-tests
8564
plugins: pycoverage,compress-pycoverage
86-
- name: Upload test results to Codecov
87-
if: ${{ !cancelled() }}
88-
uses: codecov/test-results-action@v1
89-
with:
90-
token: ${{ secrets.CODECOV_TOKEN }}
91-
files: build/test-results/test/TEST.xml
9265

9366
test_codemods:
9467
# changing the following value will significantly affect github's cost. Be careful and consult with the team before changing it.
@@ -114,29 +87,30 @@ jobs:
11487
uses: ./.github/actions/setup-oss-repos
11588
with:
11689
CODEGEN_BOT_GHE_TOKEN: ${{ secrets.CODEGEN_BOT_GHE_TOKEN }}
117-
# - name: Run ATS
118-
# uses: codecov/codecov-ats@v0.3.0
119-
# with:
120-
# static_token: ${{ secrets.CODECOV_STATIC_TOKEN }}
121-
# token: ${{ secrets.CODECOV_TOKEN }}
122-
# static_folder_to_search: src
123-
# static_folders_to_exclude: .venv
90+
- name: Run ATS
91+
env:
92+
BASE_SHA: ${{github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before}}
93+
DEFAULT_TESTS: "tests/integration/codemod/test_codemods.py"
94+
CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}
95+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
96+
COLLECT_ARGS: "--size=${{matrix.size}} --sync-graph=${{matrix.sync_graph}} --token ${{ secrets.CODEGEN_BOT_GHE_TOKEN }}"
97+
ATS_COLLECT_ARGS: "--size=${{matrix.size}},--sync-graph=${{matrix.sync_graph}},--token=${{ secrets.CODEGEN_BOT_GHE_TOKEN }},"
98+
run: |
99+
bash ./.circleci/ats.sh
124100
- name: Test with pytest
125101
timeout-minutes: 12
126102
run: |
127-
uv run pytest \
103+
TESTS_TO_RUN=$(cat codecov_ats/tests_to_run.txt)
104+
echo $TESTS_TO_RUN | xargs uv run pytest \
128105
-n auto \
129106
--size=${{matrix.size}} \
130107
--sync-graph=${{matrix.sync_graph}} \
131-
--token $CODEGEN_BOT_GHE_TOKEN \
108+
--token ${{ secrets.CODEGEN_BOT_GHE_TOKEN }} \
132109
-o junit_suite_name="${{github.job}}" \
133110
tests/codemod/test_codemods.py::test_codemods_cloned_repos
134111
env:
135112
CODEGEN_BOT_GHE_TOKEN: ${{ secrets.CODEGEN_BOT_GHE_TOKEN }}
136113
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
137-
- name: Install pycoverage
138-
run: |
139-
pip install coverage
140114
- name: Upload test results to Codecov
141115
if: ${{ !cancelled() }}
142116
uses: codecov/test-results-action@v1
@@ -164,20 +138,28 @@ jobs:
164138
- uses: actions/checkout@v4
165139
- name: Setup backend
166140
uses: ./.github/actions/setup-backend
141+
- name: Run ATS
142+
env:
143+
BASE_SHA: ${{github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before}}
144+
DEFAULT_TESTS: "tests/integration/codemod/test_verified_codemods.py"
145+
CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}
146+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
147+
COLLECT_ARGS: "--cli-api-key ${{ secrets.PROD_CLI_API_KEY }} --token ${{ secrets.CODEGEN_BOT_GHE_TOKEN }}"
148+
ATS_COLLECT_ARGS: "--cli-api-key=${{ secrets.PROD_CLI_API_KEY }},--token=${{ secrets.CODEGEN_BOT_GHE_TOKEN }},"
149+
run: |
150+
bash ./.circleci/ats.sh
167151
- name: Test with pytest
168152
timeout-minutes: 12
169153
run: |
170-
uv run pytest \
154+
TESTS_TO_RUN=$(cat codecov_ats/tests_to_run.txt)
155+
echo $TESTS_TO_RUN | xargs uv run pytest \
171156
--cli-api-key ${{ secrets.PROD_CLI_API_KEY }} \
172-
--token $CODEGEN_BOT_GHE_TOKEN \
157+
--token ${{ secrets.CODEGEN_BOT_GHE_TOKEN }} \
173158
-o junit_suite_name="${{github.job}}" \
174159
tests/codemod/test_verified_codemods.py::test_verified_codemods
175160
env:
176161
CODEGEN_BOT_GHE_TOKEN: ${{ secrets.CODEGEN_BOT_GHE_TOKEN }}
177162
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
178-
- name: Install pycoverage
179-
run: |
180-
pip install coverage
181163
- name: Upload test results to Codecov
182164
if: ${{ !cancelled() }}
183165
uses: codecov/test-results-action@v1

0 commit comments

Comments
 (0)