richardlehane / siegfried

signature-based file format identification
http://www.itforarchivists.com/siegfried
Apache License 2.0
217 stars 30 forks source link

Fixes around github actions investigations #164

Closed ross-spencer closed 2 years ago

ross-spencer commented 3 years ago

Trying out some Github action work today, I've noticed some issues in the sf code-base with notes here. These commits disable a few tests in places and fix a few others with a view to implementing a go test action (working example in personal fork here). Once fixed, the action can be added and enabled without spamming everyone.

ross-spencer commented 3 years ago

A strategy I've implemented in my workflow tests for the reference tests/long-running tests that probably don't need to be run each time is to use the -short flag and read from that during the test runs per: https://golang.org/pkg/testing/#hdr-Skipping

So the inclusion of:

if testing.Short() {
    t.Skip("Test is useful for reference and can/will fail: skipping in short mode.")
}

e.g. in pkg/pronom/parseable_test.go and pkg/pronom/patterns_test.go. Which means the nicest way of calling all tests can be used, e.g. go test -short ./... and the tests that can fail can be ignored during CI runs.

Ref: here

Related to: https://github.com/ross-spencer/siegfried/pull/1

ross-spencer commented 2 years ago

GitHub actions now part of the repo from 1.9.2 and fixes also across various commits there too.