Skip to content

Commit a0d6324

Browse files
committed
Python: Fix ignore-venv integration test
Now that we no longer support the fallback option (github#16127)
1 parent bb4952f commit a0d6324

File tree

1 file changed

+1
-31
lines changed
  • python/extractor/cli-integration-test/ignore-venv

1 file changed

+1
-31
lines changed

python/extractor/cli-integration-test/ignore-venv/test.sh

+1-31
Original file line numberDiff line numberDiff line change
@@ -17,63 +17,33 @@ mkdir dbs
1717
# set up venvs
1818
cd repo_dir
1919

20+
# make venv with some package in it (so we show that our ignore logic is correct)
2021
python3 -m venv venv
2122
venv/bin/pip install flask
2223

23-
python3 -m venv venv2
24-
2524
cd "$SCRIPTDIR"
2625

27-
# In 2.16.0 we stop extracting libraries by default, so to test this functionality we
28-
# need to force enable it. Once we release 2.17.0 and turn off library extraction for
29-
# good, we can remove the part of this test ensuring that dependencies in an active
30-
# venv are still extracted (since that will no longer be the case).
31-
export CODEQL_EXTRACTOR_PYTHON_FORCE_ENABLE_LIBRARY_EXTRACTION_UNTIL_2_17_0=1
32-
33-
# Create DBs with venv2 active (that does not have flask installed)
34-
source repo_dir/venv2/bin/activate
35-
3626
export CODEQL_EXTRACTOR_PYTHON_DISABLE_AUTOMATIC_VENV_EXCLUDE=
3727
$CODEQL database create dbs/normal --language python --source-root repo_dir/
3828

3929
export CODEQL_EXTRACTOR_PYTHON_DISABLE_AUTOMATIC_VENV_EXCLUDE=1
4030
$CODEQL database create dbs/no-venv-ignore --language python --source-root repo_dir/
4131

42-
# Create DB with venv active that has flask installed. We want to ensure that we're
43-
# still able to resolve imports to flask, but don't want to extract EVERYTHING from
44-
# within the venv. Important note is that the test-file in the repo_dir actually imports
45-
# flask :D
46-
source repo_dir/venv/bin/activate
47-
export CODEQL_EXTRACTOR_PYTHON_DISABLE_AUTOMATIC_VENV_EXCLUDE=
48-
$CODEQL database create dbs/normal-with-flask-venv --language python --source-root repo_dir/
49-
5032
# ---
5133

5234
set +x
5335

5436
EXTRACTED_NORMAL=$(unzip -l dbs/normal/src.zip | wc -l)
5537
EXTRACTED_NO_VENV_IGNORE=$(unzip -l dbs/no-venv-ignore/src.zip | wc -l)
56-
EXTRACTED_ACTIVE_FLASK=$(unzip -l dbs/normal-with-flask-venv/src.zip | wc -l)
5738

5839
exitcode=0
5940

6041
echo "EXTRACTED_NORMAL=$EXTRACTED_NORMAL"
6142
echo "EXTRACTED_NO_VENV_IGNORE=$EXTRACTED_NO_VENV_IGNORE"
62-
echo "EXTRACTED_ACTIVE_FLASK=$EXTRACTED_ACTIVE_FLASK"
6343

6444
if [[ ! $EXTRACTED_NORMAL -lt $EXTRACTED_NO_VENV_IGNORE ]]; then
6545
echo "ERROR: EXTRACTED_NORMAL not smaller EXTRACTED_NO_VENV_IGNORE"
6646
exitcode=1
6747
fi
6848

69-
if [[ ! $EXTRACTED_NORMAL -lt $EXTRACTED_ACTIVE_FLASK ]]; then
70-
echo "ERROR: EXTRACTED_NORMAL not smaller EXTRACTED_ACTIVE_FLASK"
71-
exitcode=1
72-
fi
73-
74-
if [[ ! $EXTRACTED_ACTIVE_FLASK -lt $EXTRACTED_NO_VENV_IGNORE ]]; then
75-
echo "ERROR: EXTRACTED_ACTIVE_FLASK not smaller EXTRACTED_NO_VENV_IGNORE"
76-
exitcode=1
77-
fi
78-
7949
exit $exitcode

0 commit comments

Comments
 (0)