-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16159 from RasmusWL/fix-integration-tests
Python: Fixup integration tests after no dep inst
- Loading branch information
Showing
4 changed files
with
49 additions
and
123 deletions.
There are no files selected for viewing
41 changes: 0 additions & 41 deletions
41
python/extractor/cli-integration-test/force-enable-library-extraction/disabled-test.sh
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
python/extractor/cli-integration-test/force-enable-library-extraction/repo_dir/foo.py
This file was deleted.
Oops, something went wrong.
79 changes: 0 additions & 79 deletions
79
python/extractor/cli-integration-test/ignore-venv/disabled-test.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
set -Eeuo pipefail # see https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
|
||
set -x | ||
|
||
CODEQL=${CODEQL:-codeql} | ||
|
||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
cd "$SCRIPTDIR" | ||
|
||
# start on clean slate | ||
rm -rf dbs repo_dir/venv* | ||
mkdir dbs | ||
|
||
|
||
# set up venvs | ||
cd repo_dir | ||
|
||
# make venv with some package in it (so we show that our ignore logic is correct) | ||
python3 -m venv venv | ||
venv/bin/pip install flask | ||
|
||
cd "$SCRIPTDIR" | ||
|
||
export CODEQL_EXTRACTOR_PYTHON_DISABLE_AUTOMATIC_VENV_EXCLUDE= | ||
$CODEQL database create dbs/normal --language python --source-root repo_dir/ | ||
|
||
export CODEQL_EXTRACTOR_PYTHON_DISABLE_AUTOMATIC_VENV_EXCLUDE=1 | ||
$CODEQL database create dbs/no-venv-ignore --language python --source-root repo_dir/ | ||
|
||
# --- | ||
|
||
set +x | ||
|
||
EXTRACTED_NORMAL=$(unzip -l dbs/normal/src.zip | wc -l) | ||
EXTRACTED_NO_VENV_IGNORE=$(unzip -l dbs/no-venv-ignore/src.zip | wc -l) | ||
|
||
exitcode=0 | ||
|
||
echo "EXTRACTED_NORMAL=$EXTRACTED_NORMAL" | ||
echo "EXTRACTED_NO_VENV_IGNORE=$EXTRACTED_NO_VENV_IGNORE" | ||
|
||
if [[ ! $EXTRACTED_NORMAL -lt $EXTRACTED_NO_VENV_IGNORE ]]; then | ||
echo "ERROR: EXTRACTED_NORMAL not smaller EXTRACTED_NO_VENV_IGNORE" | ||
exitcode=1 | ||
fi | ||
|
||
exit $exitcode |