Skip to content

Add GitHub Actions CI workflow for unit tests#379

Merged
lneely merged 16 commits intomainfrom
automated-testing
Mar 10, 2026
Merged

Add GitHub Actions CI workflow for unit tests#379
lneely merged 16 commits intomainfrom
automated-testing

Conversation

@lneely
Copy link
Owner

@lneely lneely commented Mar 10, 2026

Summary

  • Adds .github/workflows/ci.yml targeting the automated-testing branch
  • Installs cmake + build-essential (all test deps are glibc — pthread/rt, no external libs)
  • Builds all test binaries via cmake -B build && cmake --build build
  • Runs ctest --test-dir build --output-on-failure; workflow fails on any test failure

Test plan

  • Push to automated-testing triggers workflow
  • All 8 test binaries build successfully
  • All tests pass in CI

🤖 Generated with Claude Code

Levi Neely and others added 16 commits March 10, 2026 15:30
Adds tests/unit-tests/test_ptask_free.c to verify all code paths of the
psync_task_free fix from #377: single-owner free, last-ref destroy,
non-last-ref decrement, READY task signaling, and lock-before-refcnt
ordering. All 5 tests pass. Also adds compiled binary to .gitignore.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Triggers on push/PR to automated-testing branch. Installs cmake and
build-essential, builds all test targets via cmake, and runs ctest
--output-on-failure. Fails workflow on any test failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds tests and check targets to Makefile — no cmake required.
Each test binary is built with the correct flags (pthread, -lrt,
--wrap linker flags for prun/ptools_errptr). CI workflow installs
only build-essential, runs make tests then make check; exits non-zero
on any failure. All 8 test suites pass locally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
detect_fuse.sh runs at Makefile parse time; without fuse headers the
$(error) fires before any target runs. Adding libfuse3-dev unblocks
make tests (test binaries themselves don't link fuse).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update CI workflow to run unit tests and build verification
- Add Makefile targets for test compilation and execution
- Implement unit tests for pdbg_path, prun, and read_response
- Add test stubs for pCloud API mocking
- Add test binaries for pfs_lock_ordering and signal_safety verification
Install libfuse-dev and libssl-dev required for build
Include unit test execution in C/C++ workflow
Complete stub implementations for all required pCloud API functions
Correct function signatures for pCloud API stubs
Correct all psql function signatures to match headers
Update stub functions and build configuration
Update Makefile to use actual implementation files for utilities
- Makefile: Add test rules with real dependencies
- tests/stubs/test_stubs.c: Minimal stubs for external APIs
- tests/stubs/test_stubs_cpp.c: Stubs for C++ test
- pclsync/putil.c: Add null check in putil_strdup
- pclsync/pdbg.c: Add recursion guard in pdbg_printf
Consolidate CI configuration into c-cpp.yml
- Remove test_pfs_lock_ordering and test_signal_safety binaries
- Add tests/test_* to .gitignore to prevent future commits
@lneely lneely merged commit 79a4a56 into main Mar 10, 2026
7 checks passed
@lneely lneely deleted the automated-testing branch March 10, 2026 16:48
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