-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into sts_AN-225_batch_api_workspace_setting
- Loading branch information
Showing
19 changed files
with
98 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version = 1.10.5 | ||
sbt.version = 1.10.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.10.5 | ||
sbt.version=1.10.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
src/main/scala/org/broadinstitute/dsde/firecloud/webservice/BillingApiService.scala
This file was deleted.
Oops, something went wrong.
74 changes: 0 additions & 74 deletions
74
src/main/scala/org/broadinstitute/dsde/firecloud/webservice/Ga4ghApiService.scala
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
src/main/scala/org/broadinstitute/dsde/firecloud/webservice/NotificationsApiService.scala
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/main/scala/org/broadinstitute/dsde/firecloud/webservice/PassthroughApiService.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.broadinstitute.dsde.firecloud.webservice | ||
|
||
import akka.http.scaladsl.server.{Directives, Route} | ||
import org.broadinstitute.dsde.firecloud.FireCloudConfig | ||
import org.broadinstitute.dsde.firecloud.utils.StreamingPassthrough | ||
|
||
trait PassthroughApiService extends Directives with StreamingPassthrough { | ||
|
||
private lazy val agora = FireCloudConfig.Agora.baseUrl | ||
private lazy val rawls = FireCloudConfig.Rawls.baseUrl | ||
|
||
val passthroughRoutes: Route = concat( | ||
pathPrefix("ga4gh")(streamingPassthrough(s"$agora/ga4gh")), | ||
pathPrefix("api" / "billing")(streamingPassthrough(s"$rawls/api/billing")), | ||
pathPrefix("api" / "notifications")(streamingPassthrough(s"$rawls/api/notifications")) | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
participant_id | ||
participant_01 | ||
participant_02 | ||
participant_03 | ||
participant_04 | ||
participant_05 | ||
participant_06 | ||
participant_07 | ||
participant_08 |
9 changes: 9 additions & 0 deletions
9
src/test/resources/testfiles/tsv/PARTICIPANTS_NO_PREFIX_OR_SUFFIX.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
participant | ||
participant_01 | ||
participant_02 | ||
participant_03 | ||
participant_04 | ||
participant_05 | ||
participant_06 | ||
participant_07 | ||
participant_08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
entity:participant | ||
participant_01 | ||
participant_02 | ||
participant_03 | ||
participant_04 | ||
participant_05 | ||
participant_06 | ||
participant_07 | ||
participant_08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
TCGA-5M-AAT4-01A TCGA-5M-AAT4 primary_solid_tumorTCGA-5M-AAT4-10A TCGA-5M-AAT4 blood_derived_normalTCGA-NH-A8F8-01A TCGA-NH-A8F8 primary_solid_tumorTCGA-NH-A8F8-10A TCGA-NH-A8F8 blood-derived_normal | ||
bad-prefix:participant_id col1 col2 | ||
TCGA-5M-AAT4-01A TCGA-5M-AAT4 primary_solid_tumor | ||
TCGA-5M-AAT4-10A TCGA-5M-AAT4 blood_derived_normal | ||
TCGA-NH-A8F8-01A TCGA-NH-A8F8 primary_solid_tumor | ||
TCGA-NH-A8F8-10A TCGA-NH-A8F8 blood-derived_normal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ import akka.http.scaladsl.model.headers.OAuth2BearerToken | |
import akka.http.scaladsl.model.{HttpResponse, StatusCode, StatusCodes} | ||
import com.google.cloud.storage.StorageException | ||
import org.broadinstitute.dsde.firecloud.dataaccess.LegacyFileTypes.FILETYPE_RAWLS | ||
|
||
import org.broadinstitute.dsde.firecloud.dataaccess.{MockCwdsDAO, MockRawlsDAO} | ||
import org.broadinstitute.dsde.firecloud.mock.MockGoogleServicesDAO | ||
import org.broadinstitute.dsde.firecloud.model.ModelJsonProtocol._ | ||
|
@@ -58,15 +57,28 @@ class EntityServiceSpec extends BaseServiceSpec with BeforeAndAfterEach { | |
val tsvParticipants = FileUtils.readAllTextFromResource("testfiles/tsv/ADD_PARTICIPANTS.txt") | ||
val tsvMembership = FileUtils.readAllTextFromResource("testfiles/tsv/MEMBERSHIP_SAMPLE_SET.tsv") | ||
val tsvUpdate = FileUtils.readAllTextFromResource("testfiles/tsv/UPDATE_SAMPLES.txt") | ||
val tsvParticipantsNoPrefix = FileUtils.readAllTextFromResource("testfiles/tsv/PARTICIPANTS_NO_PREFIX.txt") | ||
val tsvParticipantsNoSuffix = FileUtils.readAllTextFromResource("testfiles/tsv/PARTICIPANTS_NO_SUFFIX.txt") | ||
val tsvParticipantsNoPrefixOrSuffix = | ||
FileUtils.readAllTextFromResource("testfiles/tsv/PARTICIPANTS_NO_PREFIX_OR_SUFFIX.txt") | ||
|
||
val tsvInvalid = FileUtils.readAllTextFromResource("testfiles/tsv/TEST_INVALID_COLUMNS.txt") | ||
|
||
val userToken: UserInfo = UserInfo("[email protected]", OAuth2BearerToken(""), 3600, "111") | ||
|
||
// (tsvType, tsvData) | ||
val asyncTSVs = List(("upsert", tsvParticipants), ("membership", tsvMembership), ("update", tsvUpdate)) | ||
val asyncTSVs = | ||
List( | ||
("upsert", tsvParticipants), | ||
("upsert", tsvParticipantsNoPrefix), | ||
("upsert", tsvParticipantsNoSuffix), | ||
("upsert", tsvParticipantsNoPrefixOrSuffix), | ||
("membership", tsvMembership), | ||
("update", tsvUpdate) | ||
) | ||
|
||
asyncTSVs foreach { case (tsvType, tsvData) => | ||
s"should return Accepted with an import jobId for (async=true + $tsvType TSV)" in { | ||
s"should return Accepted with an import jobId for (async=true + $tsvType TSV) [${tsvData.hashCode}]" in { | ||
val testCwdsDao = new SuccessfulCwdsDAO | ||
val entityService = getEntityService(cwdsDAO = testCwdsDao) | ||
val response = | ||
|
@@ -88,13 +100,17 @@ class EntityServiceSpec extends BaseServiceSpec with BeforeAndAfterEach { | |
} | ||
|
||
// (tsvType, expectedEntityType, tsvData) | ||
val goodTSVs = List(("upsert", "participant", tsvParticipants), | ||
("membership", "sample_set", tsvMembership), | ||
("update", "sample", tsvUpdate) | ||
val goodTSVs = List( | ||
("upsert", "participant", tsvParticipants), | ||
("upsert", "participant", tsvParticipantsNoPrefix), | ||
("upsert", "participant", tsvParticipantsNoSuffix), | ||
("upsert", "participant", tsvParticipantsNoPrefixOrSuffix), | ||
("membership", "sample_set", tsvMembership), | ||
("update", "sample", tsvUpdate) | ||
) | ||
|
||
goodTSVs foreach { case (tsvType, expectedEntityType, tsvData) => | ||
s"should return OK with the entity type for (async=false + $tsvType TSV)" in { | ||
s"should return OK with the entity type for (async=false + $tsvType TSV) [${tsvData.hashCode}]" in { | ||
val entityService = getEntityService() | ||
val response = | ||
entityService | ||
|
@@ -103,7 +119,7 @@ class EntityServiceSpec extends BaseServiceSpec with BeforeAndAfterEach { | |
response shouldBe RequestComplete(StatusCodes.OK, expectedEntityType) | ||
} | ||
|
||
s"should call the appropriate upsert/update method for (async=false + $tsvType TSV)" in { | ||
s"should call the appropriate upsert/update method for (async=false + $tsvType TSV) [${tsvData.hashCode}]" in { | ||
val mockedRawlsDAO = mockito[MockRawlsDAO] // mocking the mock | ||
when( | ||
mockedRawlsDAO.batchUpdateEntities(any[String], any[String], any[String], any[Seq[EntityUpdateDefinition]])( | ||
|
@@ -144,7 +160,7 @@ class EntityServiceSpec extends BaseServiceSpec with BeforeAndAfterEach { | |
|
||
} | ||
|
||
s"should send $expectedEntityType tsv to cWDS with appropriate options" in { | ||
s"should send $expectedEntityType tsv to cWDS with appropriate options [${tsvData.hashCode}]" in { | ||
// set up mocks | ||
val cwdsDAO = mockito[MockCwdsDAO] | ||
val rawlsDAO = mockito[MockRawlsDAO] | ||
|
Oops, something went wrong.