euroargodev / euroargodev/argopy

Can't run test_opt_invalid_cachedir under Windows

Open
#295 1 comment 0 reactions 0 assignees View on GitHub
help wanted internals stale
Dominant language
Python
Stars
229
Forks
52
Avg merge
2d 10h
Merged PRs (30d)
8

Description

In CI tests, we have the ``test_options/test_opt_invalid_cachedir`` test that check if an ``OptionValueError`` is indeed raised when the option ``cache_dir`` is set to a folder without writing access.
To run the test, we create a dummy folder, remove write access and try to set it as ``cache_dir``.

**The issue is that under the latest windows in Github Actions, I can't manage to create a non-writable folder !**
I've tried to use ``icacls`` (see ``argopy/tests/helpers/utils.py``) but it doesn't work, the command still return a:
```
b'processed file: read_only_folder\r
Successfully processed 1 files; Failed processing 0 files\r'
```
but ``os.stat(folder_name).st_mode`` remains 16895 instead of 16749.

I work with Mac and Linux not Windows, and can't easily try to fix this issue
If you want to give it a try, you're welcome,
I give up and skip this test for Windows platform

Contributor guide

Open the contributing guide

Research direction

Start with test_options/test_opt_invalid_cachedir and argopy/tests/helpers/utils.py, then inspect the GitHub Actions Windows test environment and the existing icacls attempt. Done means either reliably creating a non-writable cache directory so OptionValueError is tested on Windows, or documenting and applying the Windows-specific skip described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ci-cd, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.