This is an automated email from the ASF dual-hosted git repository.
yhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new cffeff78f62 Fix Dicom IO Integration Tests (#30073)
cffeff78f62 is described below
commit cffeff78f622c566e87b18ab7994444b07b482c6
Author: Svetak Sundhar <[email protected]>
AuthorDate: Tue Jan 23 19:04:33 2024 +0000
Fix Dicom IO Integration Tests (#30073)
* [BEAM-12550] Implement Parallelizable Skew and Kurtosis
(Skew implementation)
R: @TheNeuralBit
* Add failure case to Dicom IO Test
* Fix Failing Test
* lint
* remove job.cancel()
* spotless
---------
Co-authored-by: svetakvsundhar <[email protected]>
---
.../beam/sdk/io/gcp/healthcare/DicomIOReadIT.java | 40 +++++++++++++++-------
1 file changed, 28 insertions(+), 12 deletions(-)
diff --git
a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/healthcare/DicomIOReadIT.java
b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/healthcare/DicomIOReadIT.java
index e550b29541e..570844011f3 100644
---
a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/healthcare/DicomIOReadIT.java
+++
b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/healthcare/DicomIOReadIT.java
@@ -21,14 +21,12 @@ import static
org.apache.beam.sdk.io.gcp.healthcare.HL7v2IOTestUtil.HEALTHCARE_D
import java.io.IOException;
import java.net.URISyntaxException;
-import org.apache.beam.sdk.PipelineResult;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.transforms.Create;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
@@ -36,6 +34,8 @@ import org.junit.Test;
public class DicomIOReadIT {
private static final String TEST_FILE_PATH =
"src/test/resources/DICOM/testDicomFile.dcm";
private static final String TEST_FILE_STUDY_ID = "study_000000000";
+ private static final String TEST_FILE_SERIES_ID = "series_000000000";
+ private static final String TEST_FILE_INSTANCE_ID = "instance_000000000";
@Rule public transient TestPipeline pipeline = TestPipeline.create();
private String healthcareDataset;
@@ -61,13 +61,16 @@ public class DicomIOReadIT {
client.deleteDicomStore(healthcareDataset + "/dicomStores/" + storeName);
}
- @Ignore("https://github.com/apache/beam/issues/28099")
@Test
- public void testDicomMetadataRead() throws IOException {
+ public void testDicomMetadataRead() {
String webPath =
String.format(
- "%s/dicomStores/%s/dicomWeb/studies/%s",
- healthcareDataset, storeName, TEST_FILE_STUDY_ID);
+ "%s/dicomStores/%s/dicomWeb/studies/%s/series/%s/instances/%s",
+ healthcareDataset,
+ storeName,
+ TEST_FILE_STUDY_ID,
+ TEST_FILE_SERIES_ID,
+ TEST_FILE_INSTANCE_ID);
DicomIO.ReadStudyMetadata.Result result =
pipeline.apply(Create.of(webPath)).apply(DicomIO.readStudyMetadata());
@@ -82,12 +85,25 @@ public class DicomIOReadIT {
return null;
});
- PipelineResult job = pipeline.run();
+ pipeline.run();
+ }
+
+ @Test
+ public void testDicomFailedMetadataRead() {
+ String badWebPath = "foo";
+
+ DicomIO.ReadStudyMetadata.Result result =
+
pipeline.apply(Create.of(badWebPath)).apply(DicomIO.readStudyMetadata());
+
+ PAssert.that(result.getReadResponse()).empty();
+
+ PAssert.that(result.getFailedReads())
+ .satisfies(
+ (errors) -> {
+ Assert.assertTrue(errors.iterator().hasNext());
+ return null;
+ });
- try {
- job.cancel();
- } catch (UnsupportedOperationException exc) {
- // noop - if runner does not support job.cancel()
- }
+ pipeline.run();
}
}