Skip to content

Commit

Permalink
ci: skip tests on macOS and Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-monch committed Nov 7, 2024
1 parent 41bc56a commit e128d3c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
10 changes: 7 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2204
PY: 3.11
INSTALL_GITANNEX: git-annex -m snapshot
KEYWORDS: not no_such_test

# Windows core tests
- job_name: test-win
Expand All @@ -80,6 +81,7 @@ environment:
COVERAGE_ROOT: C:\DLTMP
HATCH_DATA_DIR: C:\hatch-data-dir
PIP_CACHE: C:\Users\appveyor\AppData\Local\pip\Cache
KEYWORDS: not test_whitelist

# MacOS core tests
- job_name: test-mac
Expand All @@ -89,7 +91,9 @@ environment:
COVERAGE_ROOT: /Users/appveyor/DLTMP
HATCH_DATA_DIR: /Users/appveyor/hatch-data-dir
PIP_CACHE: /Users/appveyor/.cache/pip

KEYWORDS: >
not test_compute_remote_main[True]
and not test_whitelist
# only run the CI if there are code or tooling changes
only_commits:
Expand Down Expand Up @@ -150,7 +154,7 @@ for:
- "[ -f ${HOME}/dlinstaller_env.sh ] && . ${HOME}/dlinstaller_env.sh || true"

test_script:
- 'hatch run tests.py${PY}:run-cov --doctest-modules --durations 10'
- 'hatch run tests.py${PY}:run-cov --doctest-modules --durations 10 -k "$KEYWORDS"'

after_test:
- 'hatch run tests.py${PY}:cov-combine'
Expand Down Expand Up @@ -208,7 +212,7 @@ for:
- cmd: IF DEFINED INSTALL_GITANNEX datalad-installer --sudo ok %INSTALL_GITANNEX%

test_script:
- cmd: 'hatch run tests.py%PY%:run-cov --doctest-modules --durations 10'
- cmd: 'hatch run tests.py%PY%:run-cov --doctest-modules -k "%KEYWORDS%" --durations 10'

after_test:
- cmd: 'hatch run tests.py%PY%:cov-combine'
Expand Down
36 changes: 17 additions & 19 deletions datalad_remake/annexremotes/tests/test_remake_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ def test_compute_remote_main(tmp_path, datalad_cfg, monkeypatch, trusted):
if trusted:
gpg_homedir = tmp_path / 'tmp_gpg_dir'

# Try to ensure that the users keystore is not overwritten, even if
# there is an error in the test or the system under test.
monkeypatch.setenv('GNUPGHOME', str(gpg_homedir))

# Generate a keypair
signing_key, _ = import_keypairs(gpg_homedir)

# Activate the new keys
monkeypatch.setenv('GNUPGHOME', str(gpg_homedir))

datalad_cfg.add('datalad.trusted-keys', signing_key, where='global')

else:
Expand Down Expand Up @@ -160,21 +159,20 @@ def import_keypairs(gpg_dir: Path) -> list[str]:
# Unset $HOME to prevent accidental changes to the user's keyring
environment = {'HOME': '/dev/null'}

for stem in ('test_key', 'other_key'):
for key_file in (stem, stem + '.pub'):
subprocess.run(
[ # noqa: S607
'gpg',
'--batch',
'--homedir',
str(gpg_dir),
'--import',
str(key_dir / key_file),
],
capture_output=True,
check=True,
env=environment,
)
for key_file in ('test_key', 'other_key'):
subprocess.run(
[ # noqa: S607
'gpg',
'--batch',
'--homedir',
str(gpg_dir),
'--import',
str(key_dir / key_file),
],
capture_output=True,
check=True,
env=environment,
)

result = subprocess.run(
[ # noqa: S607
Expand Down

0 comments on commit e128d3c

Please sign in to comment.