summaryrefslogtreecommitdiff
path: root/gerbonara/tests/image_support.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-10-26 23:53:23 +0200
committerjaseg <git@jaseg.de>2023-10-26 23:53:23 +0200
commit36da1fd68bcfb44957d370584231545cee0b2e20 (patch)
tree7bf1730a71392ab3de33010a56edf3ce0a2a09e6 /gerbonara/tests/image_support.py
parent9624e46147755d221c8e7cf519e9ecd416381857 (diff)
downloadgerbonara-36da1fd68bcfb44957d370584231545cee0b2e20.tar.gz
gerbonara-36da1fd68bcfb44957d370584231545cee0b2e20.tar.bz2
gerbonara-36da1fd68bcfb44957d370584231545cee0b2e20.zip
Fix failing test cases
Diffstat (limited to 'gerbonara/tests/image_support.py')
-rw-r--r--gerbonara/tests/image_support.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/gerbonara/tests/image_support.py b/gerbonara/tests/image_support.py
index 9902863..64f59ea 100644
--- a/gerbonara/tests/image_support.py
+++ b/gerbonara/tests/image_support.py
@@ -23,6 +23,7 @@ from pathlib import Path
import tempfile
import textwrap
import os
+import stat
from functools import total_ordering
import shutil
import bs4
@@ -156,10 +157,14 @@ def kicad_fp_export(mod_file, out_svg):
print(f'Building cache for {mod_file.name}')
with tempfile.TemporaryDirectory() as tmpdir:
+ os.chmod(tmpdir, 0o1777)
pretty_dir = mod_file.parent
fp_name = mod_file.name[:-len('.kicad_mod')]
- cmd = ['kicad-cli', 'fp', 'export', 'svg', '--output', tmpdir, '--footprint', fp_name, pretty_dir]
- subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ cmd = ['podman', 'run', '--mount', f'type=bind,src={pretty_dir},dst=/{pretty_dir.name}',
+ '--mount', f'type=bind,src={tmpdir},dst=/out',
+ 'registry.gitlab.com/kicad/kicad-ci/kicad-cli-docker/kicad:nightly',
+ 'kicad-cli', 'fp', 'export', 'svg', '--output', '/out', '--footprint', fp_name, f'/{pretty_dir.name}']
+ subprocess.run(cmd, check=True) #, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
out_file = Path(tmpdir) / f'{fp_name}.svg'
shutil.copy(out_file, cachefile)
else: