Skip to content

Commit

Permalink
test something fun
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurZucker committed May 1, 2024
1 parent e6c0c7b commit 0eca262
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .circleci/create_circleci_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ def to_dict(self):
command = f'echo {tests} | tr " " "\\n" >> tests.txt'
steps.append({"run": {"name": "Get tests", "command": command}})

# get test files while ignoring __init__ files
steps.append(
{"run": {"name": "Get tests", "command": """TESTFILES=$(circleci tests glob {tests} | sed 's/\S\+__init__.py//g') && \
echo $TESTFILES | tr ' ' '\n' | sort | uniq > circleci_test_files.txt && \
cat circleci_test_files.txt && \
TESTFILES=$(circleci tests split --split-by=timings circleci_test_files.txt) && \
# massage filepaths into format manage.py test accepts && \
TESTFILES=$(echo $TESTFILES | tr "/" "." | sed 's/.py//g') && \
echo $TESTFILES"""}
}
)

# grep -oE "class[[:space:]]+[[:alnum:]_]+[[:space:]]*\(" tests/models/llama/test_modeling_llama.py | grep 'Test' | sed -E 's/class[[:space:]]+([[:alnum:]_]+)[[:space:]]*\(/\1/'
command = 'TESTS=$(circleci tests split tests.txt --split-by=timings --timings-type=testname) && echo $TESTS > splitted_tests.txt'
steps.append({"run": {"name": "Split tests", "command": command}})
Expand Down

0 comments on commit 0eca262

Please sign in to comment.