Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed tests #113

Closed
0xorial opened this issue May 27, 2022 · 9 comments
Closed

Failed tests #113

0xorial opened this issue May 27, 2022 · 9 comments

Comments

@0xorial
Copy link
Contributor

0xorial commented May 27, 2022

If I run yarn run tests I get 3 tests failed. Is that normal?

@cmdcolin
Copy link
Contributor

Which tests fail? Can you paste a complete log files?

@0xorial
Copy link
Contributor Author

0xorial commented May 27, 2022

PS C:\Users\user\repos\cram-js> yarn run test
yarn run v1.22.17
$ jest





 PASS  test/binary-parser.test.ts
                                 


 PASS  test/crai.test.ts           
                                   

 PASS  test/util.test.ts           
                                   
 PASS  test/example-code.test.ts (5.614 s)
  ● Console

    console.log
      C:\Users\user\repos\cram-js

      at Object.<anonymous> (test/example-code.test.ts:4:9)

 PASS  test/retry.test.ts (5.711 s)     
 PASS  test/lossy-names.test.ts
 FAIL  test/parse.test.ts (5.812 s)       
  ● CRAM reader › can read a bigger cram file

    CRAM version 114 not supported

      90 |     const definition = cramFileDefinitionParser.parser.parse(headbytes).result
      91 |     if (definition.majorVersion !== 2 && definition.majorVersion !== 3) {
    > 92 |       throw new CramUnimplementedError(
         |             ^
      93 |         `CRAM version ${definition.majorVersion} not supported`,
      94 |       )
      95 |     }

      at CramFile.<anonymous> (src/cramFile/file.js:92:13)
      at fulfilled (src/cramFile/file.js:5:58)

  ● CRAM reader › can read an even bigger cram file

    CRAM version 114 not supported

      90 |     const definition = cramFileDefinitionParser.parser.parse(headbytes).result
      91 |     if (definition.majorVersion !== 2 && definition.majorVersion !== 3) {
    > 92 |       throw new CramUnimplementedError(
         |             ^
      93 |         `CRAM version ${definition.majorVersion} not supported`,
      at fulfilled (src/cramFile/file.js:5:58)

 FAIL  test/indexedfile.test.ts (13.768 s)
  ● .crai indexed cram file › can fetch some regions of tomato example data correctly

    invalid .crai index file

      107 |             // if there are other characters in the file besides
      108 |             // space and \r, something is wrong.
    > 109 |             throw new CramMalformedError('invalid .crai index file')
          |                   ^
      110 |           }
      111 |         }
      112 |

      at src/craiIndex.js:109:19

         |               ^
      84 |         `${this.file}: container header at ${position} indicates that the container has length ${header1.length}, which extends beyond the length of the file. Skipping this container.`,
      85 |       )
      86 |       return undefined

      at CramContainer.<anonymous> (src/cramFile/container/index.js:83:15)
      at fulfilled (src/cramFile/container/index.js:5:58)


Test Suites: 2 failed, 7 passed, 9 total
Tests:       3 failed, 259 passed, 262 total
Snapshots:   1 passed, 1 total
Time:        28.882 s
Ran all test suites.
error Command failed with exit code 1.

@cmdcolin
Copy link
Contributor

odd! have not seen any failing tests like that before.

this happens with a clean repo e.g. just after cloning the repo, ran yarn, then yarn test?

the only difference i can see from my test environment is that you are using windows and i have linux but not sure why that would change anything

@cmdcolin
Copy link
Contributor

can confirm that booting up a windows VM from modern.ie (MSEdge on Win10) https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ and testing on that platform has the same errors posted by @0xorial

@rbuels
Copy link
Contributor

rbuels commented May 27, 2022

is there any potential to get our CI on windows?

@cmdcolin
Copy link
Contributor

might be able to do CI on windows. random note: wsl on windows works ok, it is just plain old windows that has the issue

@cmdcolin
Copy link
Contributor

cmdcolin commented May 30, 2022

looks like the failed tests are three so-called 'extended' tests which reference test data that is not in the main repo using symlinks (see arrow icons here) https://github.com/GMOD/cram-js/tree/master/test/data/extended that are only valid on dev machines, they were only used during early library development i think

the reason these tests fail on windows is because git on windows clones the symlinks wrong by default, and then the logic in the tests for detecting the symlinks gets confused and thinks that they are valid, and then fails to interpret them

there are about 3 failed tests corresponding to the 3 extended tests

maybe we can probably remove the extended data tests or reduce them in size. alternatively, you can use wsl, as mentioned above, or

git clone -c core.symlinks=true https://github.com/GMOD/cram-js

This helps preserve the symlinks. Requires administrative console in windows

@cmdcolin
Copy link
Contributor

should be able to just use normal clone and test now on master branch, the extended tests are removed now

@cmdcolin
Copy link
Contributor

thanks for reporting :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants