Skip to content

Commit

Permalink
change format
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tz committed Apr 8, 2024
1 parent 1e46a08 commit 8dcbc9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/check_runtimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
logger = logging.getLogger("capa.tests.data")

THRESHOLD = 60 * 3
TARGET_EXTS = (".exe_", ".dll_", ".elf_", ".sys_", ".raw32", ".raw64", ".BinExport")
TARGET_EXTS = (".exe_", ".dll_", ".elf_", ".sys_", ".raw32", ".raw64") # TODO add , ".BinExport"
IGNORED_DIRS = ("aarch64",)


Expand All @@ -43,9 +43,13 @@ def main(argv=None):
continue

time0 = time.time()
capa.main.main(["-q", "-v", str(file)])
capa_ret = capa.main.main(["-q", "-v", "-d", str(file)])
diff = time.time() - time0

if capa_ret:
logger.info("capa failed on file %s", file)
test_failed = True

if diff > THRESHOLD:
logger.info("capa ran for %s seconds, please provide a different sample so we can test more quickly", diff)
test_failed = True
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Get modified files
id: files
uses: Ana06/[email protected]
with:
format: 'csv'
- name: Check capa runtime on modified files
run: python .github/check_runtimes.py ${{ steps.files.outputs.all }}
run: |
cd tests/data
python .github/check_runtimes.py ${{ steps.files.outputs.all }}

0 comments on commit 8dcbc9e

Please sign in to comment.