dnanexus / dxWDL

Workflow Description Language compiler for the DNAnexus platform
Apache License 2.0
40 stars 17 forks source link

Running unit tests seems to require access to staging environment #439

Closed TomasMikula closed 4 years ago

TomasMikula commented 4 years ago

Running sbt test (after a successful dx login) results in

[info] Run completed in 43 seconds, 937 milliseconds.
[info] Total number of tests run: 211
[info] Suites: completed 24, aborted 1
[info] Tests: succeeded 183, failed 28, canceled 0, ignored 15, pending 0
[info] *** 1 SUITE ABORTED ***
[info] *** 28 TESTS FAILED ***

Here are some of the failures.

[info] - should download files as strings *** FAILED ***
[info]   java.lang.Exception: Could not find project dxWDL_playground, you probably need to be logged into
[info] the platform on staging.
[info] - should detect and provide legible error for archived files *** FAILED ***
[info]   java.lang.Exception: Project ArchivedStuff not found
[info] - should bulk describe DxFiles with one project *** FAILED ***
[info]   com.dnanexus.exceptions.ResourceNotFoundException: The entity project-FGpfqjQ0ffPF1Q106JYP2j3v could not be found
[info] - should bulk describe a file without project *** FAILED ***
[info]   0 was not equal to 1 (DxFileTest.scala:36)
[info] - should throw IllegalArgumentException due to missing inputs in custom_reorg section *** FAILED ***
[info]   java.lang.Exception: Error running command dx describe /release_test/mummer_nucmer_aligner --json

I suppose a login to some privileged environment is required, but according to the developer guide, it should not be necessary for running the unit tests.

commandlinegirl commented 4 years ago

Many thanks for bringing it to our attention! The unit tests should indeed pass here. We'll look into it.

jdidion commented 4 years ago

It is unavoidable that some of the unit tests require being logged into a production or staging account. What I have done is 1) tag all tests that make any API connection to DNAnexus, and 2) add an assumption to tests that call the API that will fail (thus skipping the test) if the user is not currently logged in.