Skip to content

Commit 474100e

Browse files
authored
ci(core): reduce duplicate CI and normalize Windows assertions (#749)
Signed-off-by: phernandez <paul@basicmachines.co>
1 parent b3d5448 commit 474100e

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ concurrency:
55
cancel-in-progress: true
66

77
on:
8+
# Trigger: PR branch pushes already publish commit statuses that show up on the PR.
9+
# Why: running the full matrix on both push and pull_request doubles CI time for the
10+
# exact same branch head commit.
11+
# Outcome: each branch push runs the test suite once, including PR updates.
812
push:
9-
pull_request:
10-
branches: [ "main" ]
1113

1214
jobs:
1315
static-checks:

tests/indexing/test_batch_indexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,4 +734,4 @@ async def test_batch_indexer_does_not_inject_frontmatter_when_sync_enforcement_i
734734
assert entity.permalink == existing_permalink
735735
assert frontmatter_writer.await_count == 0
736736
assert indexed.markdown_content == persisted_content
737-
assert await file_service.read_file_content(path) == persisted_content
737+
assert (await file_service.read_file_bytes(path)).decode("utf-8") == persisted_content

tests/sync/test_sync_one_markdown_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ async def test_sync_one_markdown_file_returns_original_content_when_no_rewrite_n
153153

154154
assert frontmatter_writer.await_count == 0
155155
assert result.markdown_content == persisted_content
156-
assert file_path.read_text(encoding="utf-8") == persisted_content
156+
assert file_path.read_bytes().decode("utf-8") == persisted_content
157157
assert result.checksum == await sync_service.file_service.compute_checksum(
158158
"notes/no-rewrite.md"
159159
)
@@ -248,7 +248,7 @@ async def test_sync_one_markdown_file_indexes_thematic_break_content_without_fro
248248
persisted_content = file_path.read_bytes().decode("utf-8")
249249

250250
assert result.markdown_content == persisted_content
251-
assert file_path.read_text(encoding="utf-8") == persisted_content
251+
assert file_path.read_bytes().decode("utf-8") == persisted_content
252252
index_entity_data.assert_awaited_once_with(
253253
result.entity,
254254
content=persisted_content,

0 commit comments

Comments
 (0)