chrisbillows / raindrop-todoist-syncer

Converts favourited Raindrops into tasks in Todoist.
2 stars 1 forks source link

Add GitHub Workflow to repo #31

Closed chrisbillows closed 6 months ago

chrisbillows commented 7 months ago

GitHub workflow Quickstart

Aim should be for this to run Ruff and Pytest.

chrisbillows commented 7 months ago

The GitHub workflow issue needs to wait on #42 as pytest currently fails due to test structure.

chrisbillows commented 6 months ago

There has been a slew of issues began by #40 which I will document here.

40 (Issue) Add pytest/unit tests to pre-commit

41 (PR) Add pytest/unit tests to pre-commit

42 (Issue) Decouple tests from local installation (Fixed by #45 (PR) Refactor RaindropOauthHandler)

43 (Issue) Refactor RaindropOauthHandler / #45 (PR) Refactor RaindropOauthHandler

Pytest was added to pre-commit in #40 / #41 - subsequently discovered it's not recommended (see: Comment).

Pytest pre-commit wouldn't pass because some tests were directly coupled - directly validating - the .env file. This was corrected in #42 / #43 / #45.

Pytest then passed locally - but failed in pre-commit: it was discovering no tests.

Pre-commit only runs on changed files. No changed python files means no tests to discover. (This was resolved here by passing additional arguments to pytest here: 49b69fd).

Pytest now passes pre-commit.

However, pytest now has a series of test fails in GitHub workflow. Certain variables in the .env seem to be available to pytest in pre-commit? But they are not available in the GitHub workflow environment.

Resisting the urge to deep dive, #46 will implement a hopefully more wholesale solution.

To close this issue, pytest is commented out: 0bf3439 (to be reinstated in #46).