go-fed / activity

ActivityStreams & ActivityPub in golang, oh my!
BSD 3-Clause "New" or "Revised" License
703 stars 112 forks source link

New tests for v1 pub #105

Closed cjslep closed 4 years ago

cjslep commented 5 years ago

Add or port unit tests for the v1 pub package.

cjslep commented 5 years ago

base_actor is now covered 52bc5fb9a5028cbd421bdf490506efc296227b0f

Remaining:

cjslep commented 5 years ago

As of b4b18b96faa0946b9d6685202d42d530562739d1

This roughly puts unit test completeness at 25%.

cjslep commented 5 years ago

Storytime:

This is why I unit test. Still many more to go.

cjslep commented 4 years ago

I broke a bunch of tests at some point when building out apcore.

Requires re-running the mockgen tool and fixing the expectations.

cjslep commented 4 years ago
cjslep commented 4 years ago

Been on a sprint to get as much unit testing done as possible. The only place left that needs unit tests is the C2S code (social_wrapped_callbacks.go). Due to lack of popularity, I'm not going to tackle those at this time.

The command go test -coverprofile=t.out reports coverage: 71.0% of statements.

The command go test -v | grep -c PASS over-counts the number of tests since they're grouped into subtests, so while it reports 233, the true number is probably in the 200-ish range.

The command go tool cover -html=t.out reports per-file coverage as (ordered highest to lowest):

file % coverage
version.go 100.0%
transport.go 89.8%
federating_wrapped_callbacks.go 82.6%
handlers.go 80.6%
side_effect_actor.go 78.1%
base_actor.go 75.0%
util.go 72.9%
social_wrapped_callbacks.go 25.8%

Marking closed.