Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 605f2bf

Browse filesBrowse files
committed
Python: Add integration test
1 parent 0c1b379 commit 605f2bf
Copy full SHA for 605f2bf

File tree

7 files changed

+37
-0
lines changed
Filter options

7 files changed

+37
-0
lines changed
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
| name |
2+
+-------------------------------+
3+
| .hidden_file.py |
4+
| foo.py |
5+
| visible_file_in_hidden_dir.py |
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| name |
2+
+-----------------+
3+
| .hidden_file.py |
4+
| foo.py |
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import python
2+
3+
select any(File f).getShortName() as name order by name

‎python/extractor/cli-integration-test/hidden-files/repo_dir/.hidden_dir/visible_file_in_hidden_dir.py

Copy file name to clipboardExpand all lines: python/extractor/cli-integration-test/hidden-files/repo_dir/.hidden_dir/visible_file_in_hidden_dir.py
Whitespace-only changes.

‎python/extractor/cli-integration-test/hidden-files/repo_dir/.hidden_file.py

Copy file name to clipboardExpand all lines: python/extractor/cli-integration-test/hidden-files/repo_dir/.hidden_file.py
Whitespace-only changes.
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(42)
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
set -Eeuo pipefail # see https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
4+
5+
set -x
6+
7+
CODEQL=${CODEQL:-codeql}
8+
9+
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
10+
cd "$SCRIPTDIR"
11+
12+
rm -rf db db-skipped
13+
14+
# Test 1: Default behavior should be to extract files in hidden directories
15+
$CODEQL database create db --language python --source-root repo_dir/
16+
$CODEQL query run --database db query.ql > query-default.actual
17+
diff query-default.expected query-default.actual
18+
19+
# Test 2: Setting the relevant extractor option to true skips files in hidden directories
20+
$CODEQL database create db-skipped --language python --source-root repo_dir/ --extractor-option python.skip_hidden_directories=true
21+
$CODEQL query run --database db-skipped query.ql > query-skipped.actual
22+
diff query-skipped.expected query-skipped.actual
23+
24+
rm -rf db db-skipped

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.