Skip to content

Commit cf1098a

Browse files
m0mosenpaifacebook-github-bot
authored andcommitted
Updated tests scripts to run tests from one directory higher (#461)
Summary: Related to discussion on this with gbleaney. PR #433 use of relative imports causes `Import beyond top-level package` errors. Internally, relative imports are required to pass the tests whereas on GitHub, this causes issues. This PR fixes that issue by running tests from one directory higher, unblocking #433. Pull Request resolved: #461 Reviewed By: dkgi Differential Revision: D30518016 Pulled By: gbleaney fbshipit-source-id: e7d76f2059bde5110849923887f928459228e0a8
1 parent ee74ba3 commit cf1098a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.github/workflows/pysa.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
unzip -qq ./stubs/typeshed/typeshed.zip -d ./typeshed/
4141
./scripts/setup.sh --local --no-tests
4242
make -C source
43-
echo "PYTHONPATH=$GITHUB_WORKSPACE:$PYTHONPATH" >> $GITHUB_ENV
43+
echo "PYTHONPATH=$GITHUB_WORKSPACE/..:$PYTHONPATH" >> $GITHUB_ENV
4444
echo "pythonLocation=$GITHUB_WORKSPACE:$pythonLocation" >> $GITHUB_ENV
4545
echo "PYRE_BINARY=$GITHUB_WORKSPACE/source/_build/default/main.exe" >> $GITHUB_ENV
4646
echo "PYRE_TYPESHED=$GITHUB_WORKSPACE/typeshed/typeshed-master/" >> $GITHUB_ENV

scripts/run-python-tests.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
set -e
88

99
SCRIPTS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
10-
cd "${SCRIPTS_DIRECTORY}/.."
10+
cd "${SCRIPTS_DIRECTORY}/../.."
1111

1212
echo ' Enumerating test files:'
13-
files=$(find client -name '*_test.py' ! -name 'watchman_test.py')
13+
files=$(find 'pyre-check/client' -name '*_test.py' ! -name 'watchman_test.py')
1414
echo "${files}"
1515
if [[ -z "${files}" ]]; then
1616
echo 'No test files found, exiting.'

tools/pysa_integration_tests/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def run_pysa_integration_test(
155155
if run_from_source:
156156
command = [
157157
"python",
158-
"-m" "client.pyre",
158+
"-m" "pyre-check.client.pyre",
159159
"--noninteractive",
160160
"analyze",
161161
]

0 commit comments

Comments
 (0)