Skip to content

Add CI workflow for tests to match existing README badge#13

Open
yarikoptic wants to merge 1 commit intomagland:mainfrom
yarikoptic:enh-ci
Open

Add CI workflow for tests to match existing README badge#13
yarikoptic wants to merge 1 commit intomagland:mainfrom
yarikoptic:enh-ci

Conversation

@yarikoptic
Copy link
Copy Markdown

README.md already had a tests badge pointing at
.github/workflows/tests.yml, but that workflow never existed, so the badge rendered as "repo or workflow not found".

Add the missing workflow:

  • pytest across Python 3.10-3.13
  • coverage uploaded to Codecov from the 3.12 job
  • 10 min job timeout (tests fetch remote HDF5 files from DANDI)

ATM ran act (http://github.com/nektos/act) locally ... lapptop is a bit overloaded so it failed with

 =========================== short test summary info ============================
| FAILED tests/test_main.py::test_disk_cache - assert 2.194648504257202 < 2
| ========================= 1 failed, 4 passed in 33.91s =========================
[Tests/test-3]   ❌  Failure - Main Run tests [37.666522389s]
[Tests/test-3] exitcode '1': failure
[Tests/test-3] ⭐ Run Complete job
[Tests/test-3]   ✅  Success - Complete job
[Tests/test-3] 🏁  Job failed
| tests/test_main.py::test_presigned_url PASSED                            [100%]
| 
| =================================== FAILURES ===================================
| _______________________________ test_disk_cache ________________________________
| 
|     def test_disk_cache():
|         tmp_dirname = '/tmp/remfile_test_cache'
|         if os.path.exists(tmp_dirname):
|             assert tmp_dirname.startswith('/tmp/')
|             shutil.rmtree(tmp_dirname)
|         disk_cache = remfile.DiskCache(tmp_dirname)
|     
|         timer = time.time()
|         test_example2(disk_cache=disk_cache)
|         elapsed = time.time() - timer
|         print(f'Elapsed time for uncached read: {elapsed} seconds')
|     
|         # the second time, it should be cached already
|         timer = time.time()
|         test_example2(disk_cache=disk_cache)
|         elapsed = time.time() - timer
|         print(f'Elapsed time for cached read: {elapsed} seconds')
| >       assert elapsed < 2
| E       assert 2.1814591884613037 < 2
| 
| tests/test_main.py:85: AssertionError
| ----------------------------- Captured stdout call -----------------------------
| Loading 1 chunks starting at 0 (0.1024 million bytes)
| Loading 1 chunks starting at 1368288 (0.1024 million bytes)
| Loading 1 chunks starting at 1367167 (0.1024 million bytes)
| Loading 1 chunks starting at 1567739 (0.1024 million bytes)
| Loading 1 chunks starting at 1239144 (0.1024 million bytes)
| Loading 1 chunks starting at 1231694 (0.1024 million bytes)
| Loading 1 chunks starting at 284125 (0.1024 million bytes)
| starting_time: 0.0
| rate: 20000.0
| data shape: (1220698000, 96)
| Loading 1 chunks starting at 650132 (0.1024 million bytes)
| Loading 1 chunks starting at 11596 (0.1024 million bytes)
| Loading 1 chunks starting at 206 (0.1024 million bytes)
| Loading 2 chunks starting at 1 (0.2048 million bytes)
| Loading 4 chunks starting at 3 (0.4096 million bytes)
| Loading 7 chunks starting at 7 (0.7168 million bytes)
| Loading 12 chunks starting at 14 (1.2288 million bytes)
| Fetching 1228800 bytes in 2 threads
| Loading 21 chunks starting at 26 (2.1504 million bytes)
| Fetching 2150400 bytes in 3 threads
| Loading 30 chunks starting at 47 (3.072 million bytes)
| Fetching 3072000 bytes in 3 threads
| Loading 30 chunks starting at 77 (3.072 million bytes)
| Fetching 3072000 bytes in 3 threads
| Cleaning up cache
| Loading 30 chunks starting at 107 (3.072 million bytes)
| Fetching 3072000 bytes in 3 threads
| Loading 30 chunks starting at 137 (3.072 million bytes)
| Fetching 3072000 bytes in 3 threads
| Cleaning up cache
| Loading 30 chunks starting at 167 (3.072 million bytes)
| Fetching 3072000 bytes in 3 threads
| Cleaning up cache
| Loading 9 chunks starting at 197 (0.9216 million bytes)
| Loading 16 chunks starting at 207 (1.6384 million bytes)
| Fetching 1638400 bytes in 3 threads
| Loading 28 chunks starting at 223 (2.8672 million bytes)
| Fetching 2867200 bytes in 3 threads
| Cleaning up cache
| Loading 30 chunks starting at 251 (3.072 million bytes)
| Fetching 3072000 bytes in 3 threads
| Loading 30 chunks starting at 281 (3.072 million bytes)
| Fetching 3072000 bytes in 3 threads
| Cleaning up cache
| Elapsed time: 6.989373207092285 seconds
| 110503440
| Elapsed time for uncached read: 8.661812543869019 seconds
| starting_time: 0.0
| rate: 20000.0
| data shape: (1220698000, 96)
| Cleaning up cache
| Cleaning up cache
| Cleaning up cache
| Cleaning up cache
| Cleaning up cache
| Elapsed time: 1.689589023590088 seconds
| 110503440
| Elapsed time for cached read: 2.1814591884613037 seconds
| ================================ tests coverage ================================
| _______________ coverage: platform linux, python 3.13.12-final-0 _______________
| 
| Coverage XML written to file coverage.xml
| =========================== short test summary info ============================
| FAILED tests/test_main.py::test_disk_cache - assert 2.1814591884613037 < 2
| ========================= 1 failed, 4 passed in 31.31s =========================
[Tests/test-4]   ❌  Failure - Main Run tests [34.873787224s]
[Tests/test-4] exitcode '1': failure
[Tests/test-4] ⭐ Run Complete job
[Tests/test-4]   ✅  Success - Complete job
[Tests/test-4] 🏁  Job failed
Error: Job 'test' failed

but others seems passed nicely before etc... Let's see what CI says

README.md already had a tests badge pointing at
.github/workflows/tests.yml, but that workflow never existed,
so the badge rendered as "repo or workflow not found".

Add the missing workflow:
- pytest across Python 3.10-3.13
- coverage uploaded to Codecov from the 3.12 job
- 10 min job timeout (tests fetch remote HDF5 files from DANDI)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant