-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] fix transitive target failure check in bloop export (#287)
* fix transitive target check in bloop export * update changelog
- Loading branch information
1 parent
974d8cb
commit 0107ce5
Showing
4 changed files
with
65 additions
and
8 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
10 changes: 10 additions & 0 deletions
10
server/src/test/java/org/jetbrains/bsp/bazel/server/bloop/BUILD
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
33 changes: 33 additions & 0 deletions
33
server/src/test/java/org/jetbrains/bsp/bazel/server/bloop/BloopExporterTest.kt
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,33 @@ | ||
package org.jetbrains.bsp.bazel.server.bloop | ||
|
||
import ch.epfl.scala.bsp4j.BuildTargetIdentifier | ||
import org.jetbrains.bsp.bazel.server.bloop.BloopExporter.BazelExportFailedException | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.fail | ||
|
||
class BloopExporterTest { | ||
@Test | ||
fun export_project_with_failed_direct_target_succeeds() { | ||
val projectTargets = setOf(BuildTargetIdentifier("a"), BuildTargetIdentifier("b")) | ||
val failedTargets = setOf(BuildTargetIdentifier("a")) | ||
|
||
try { | ||
BloopExporter.validateNoFailedExternalTargets(projectTargets, failedTargets) | ||
} catch (ex: BazelExportFailedException) { | ||
fail(ex) | ||
} | ||
} | ||
|
||
@Test | ||
fun export_project_with_failed_transitive_target_fails() { | ||
val projectTargets = setOf(BuildTargetIdentifier("a"), BuildTargetIdentifier("b")) | ||
val failedTargets = setOf(BuildTargetIdentifier("c")) | ||
|
||
try { | ||
BloopExporter.validateNoFailedExternalTargets(projectTargets, failedTargets) | ||
} catch (ex: BazelExportFailedException) { | ||
return | ||
} | ||
fail("a BazelExportFailedException was expected but none was thrown") | ||
} | ||
} |