rillig / gobco

Measure branch coverage of golang tests
62 stars 12 forks source link

Tests referring mock non-go files fails with errors #10

Closed anmolbabu closed 4 years ago

anmolbabu commented 4 years ago
ababu17$ gobco pkg/models/job_test.go 
--- FAIL: TestGetFlow (0.00s)
    defs_test.go:25: failed to parse definitions from /var/folders/dc/ffvyv57j5dzf20lp3tlqfpqw0000gn/T/gobco-9b9d3277-4c11-4dde-9cf0-66bbd231fc28/src/......../pkg/models/mocks/abc.yaml.Error failed to read contents of file /var/folders/dc/ffvyv57j5dzf20lp3tlqfpqw0000gn/T/gobco-9b9d3277-4c11-4dde-9cf0-66bbd231fc28/src/....../pkg/models/mocks/abc.yaml: file /var/folders/dc/ffvyv57j5dzf20lp3tlqfpqw0000gn/T/gobco-9b9d3277-4c11-4dde-9cf0-66bbd231fc28/src/......../pkg/models/mocks/abc.yaml does not exist
    --- FAIL: TestGetFlow/Case_1:_Successful_get_flow (0.00s)
        defs_test.go:301: Expected error: false but got error true
--- FAIL: TestSetSHA256Sum (0.00s)
    job_test.go:24: failed to fetch defs. Error: &os.PathError{Op:"open", Path:"mocks/abc.yaml", Err:0x2}
    --- FAIL: TestSetSHA256Sum/Case_2:_type_only_changed (0.00s)
        job_test.go:72: expecetd: false, found: true
    --- FAIL: TestSetSHA256Sum/Case_3:_name_slightly_changing (0.00s)
        job_test.go:72: expected: false, found: true
FAIL
FAIL    ...../pkg/models    0.543s
exit status 1
rillig commented 4 years ago

Please provide more detailed instructions on how to reproduce the problem.

I tried to reproduce it with a simple project that has just a file and a test that checks whether the file exists. That worked as expected.