Skip to content

Commit b89cf71

Browse files
authored
Move codemod tests into tests/integration (#76)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [x] I have added tests for my changes - [x] I have updated the documentation or added new documentation as needed - [x] I have read and agree to the [Contributor License Agreement](../CLA.md)
1 parent dc1c1f5 commit b89cf71

File tree

142 files changed

+37
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+37
-33
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ commands:
7575
steps:
7676
- restore_cache:
7777
keys:
78-
- v1-verified-codemod-repos-{{ checksum "tests/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
78+
- v1-verified-codemod-repos-{{ checksum "tests/integration/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
7979
- run:
8080
command: |
8181
uv run --frozen gs codemod clone-repos --verified-codemod-repos --token ${CODEGEN_BOT_GHE_TOKEN}
8282
- save_cache:
8383
paths:
8484
- $GITHUB_WORKSPACE
85-
key: v1-verified-codemod-repos-{{ checksum "tests/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
85+
key: v1-verified-codemod-repos-{{ checksum "tests/integration/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
8686
build-wheels:
8787
parameters:
8888
base_packages:
@@ -237,7 +237,7 @@ jobs:
237237
- fetch-verified-codemods
238238
- cache-verified-codemod-repos
239239
- run_ats:
240-
default_tests: "tests/codemod/test_verified_codemods.py"
240+
default_tests: "tests/integration/codemod/test_verified_codemods.py"
241241
codecov_flags: "smart-tests-codemod"
242242
collect_args: --cli-api-key ${PROD_CLI_API_KEY} --token ${CODEGEN_BOT_GHE_TOKEN}
243243
ats_collect_args: --cli-api-key=${PROD_CLI_API_KEY},--token=${CODEGEN_BOT_GHE_TOKEN},
@@ -264,7 +264,7 @@ jobs:
264264
- clone-repos:
265265
extra_repos: false
266266
- run_ats:
267-
default_tests: "tests/codemod/test_codemods.py"
267+
default_tests: "tests/integration/codemod/test_codemods.py"
268268
codecov_flags: "smart-tests-codemod-oss"
269269
collect_args: --size=<<parameters.size>> --sync-graph=<<parameters.sync_graph>> --token ${CODEGEN_BOT_GHE_TOKEN}
270270
ats_collect_args: --size=<<parameters.size>>,--sync-graph=<<parameters.sync_graph>>,--token=${CODEGEN_BOT_GHE_TOKEN},
@@ -297,7 +297,7 @@ jobs:
297297
if [ "<<parameters.extra_repos>>" = "true" ]; then
298298
EXTRA_REPOS_ARG="--extra-repos=true"
299299
fi
300-
PYTEST_ARGS="${EXTRA_REPOS_ARG} --token ${CODEGEN_BOT_GHE_TOKEN} -o junit_suite_name=\"${CIRCLE_JOB}\" tests/codemod/test_parse.py"
300+
PYTEST_ARGS="${EXTRA_REPOS_ARG} --token ${CODEGEN_BOT_GHE_TOKEN} -o junit_suite_name=\"${CIRCLE_JOB}\" tests/integration/codemod/test_parse.py"
301301
echo "Running tests with args: $PYTEST_ARGS"
302302
TESTS_TO_RUN=$(PYTEST_ARGS=${PYTEST_ARGS} ./.circleci/collect.sh)
303303
echo $TESTS_TO_RUN | circleci tests run --command "ulimit -s unlimited; xargs uv run --frozen pytest -n auto ${PYTEST_ARGS}"

.gitattributes

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

.github/disallowed-words.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:ac0b7be00533f882fb174c498c27372fa78d3ec2d65c0e885475bf92b43b7303
3-
size 337
2+
oid sha256:c47fe11113256de71968b186bd459732c5f29547b9a57275f671502e9ebd8327
3+
size 328

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ uv-*.tar.gz
6363
graph-sitter-types/out/**
6464
graph-sitter-types/typings/**
6565
coverage.json
66-
tests/verified_codemods/codemod_data/repo_commits.json
66+
tests/integration/verified_codemods/codemod_data/repo_commits.json
6767

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
hooks:
2020
- id: biome-check
2121
additional_dependencies: ["@biomejs/[email protected]"]
22-
exclude: (src/codemods/eval)|(tests/unit/skills)|(tests/unit/output)|(tests/verified_codemods)|(docs/samples)
22+
exclude: (src/codemods/eval)|(tests/unit/codegen/sdk/skills)|(tests/unit/codegen/sdk/output)|(tests/integration/verified_codemods)|(docs/samples)
2323

2424
- repo: https://github.com/MarcoGorelli/cython-lint
2525
rev: v0.16.6

CLA.md

Lines changed: 16 additions & 16 deletions

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ pythonVersion = "3.12"
196196
enableExperimentalFeatures = true
197197
[tool.pytest.ini_options]
198198
# addopts = -v
199+
pythonpath = "."
199200
norecursedirs = "repos expected"
200201
# addopts = -v --cov=app --cov-report=term
201202

src/codegen/sdk/testing/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
BASE_TMP_DIR = Path(os.getenv("GITHUB_WORKSPACE", tempfile.gettempdir()))
1919
BASE_PATH: Path = Path(__file__).parent.parent.parent.parent.parent
20-
TEST_DIR: Path = BASE_PATH / "tests" / "codemod"
20+
TEST_DIR: Path = BASE_PATH / "tests" / "integration" / "codemod"
2121
CODEMOD_PATH: Path = BASE_PATH / "src" / "codemods"
22-
VERIFIED_CODEMOD_DIR: Path = BASE_PATH / "tests" / "verified_codemods"
22+
VERIFIED_CODEMOD_DIR: Path = BASE_PATH / "tests" / "integration" / "verified_codemods"
2323
VERIFIED_CODEMOD_DATA_DIR: Path = VERIFIED_CODEMOD_DIR / "codemod_data"
2424
VERIFIED_CODEMOD_DIFFS: Path = VERIFIED_CODEMOD_DIR / "verified_codemod_diffs"
2525

src/codemods/README.md

Lines changed: 1 addition & 1 deletion

tests/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/shared/README.md

Lines changed: 4 additions & 0 deletions

0 commit comments

Comments
 (0)