Skip to content

Commit a95be23

Browse files
committed
gh-41 generate smaller BDD test dataset for CI pipeline
Signed-off-by: Victor Chang <[email protected]>
1 parent fcd98f5 commit a95be23

9 files changed

+107
-59
lines changed

tests/Integration.Test/Drivers/DicomInstanceGenerator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ public DicomFile GenerateNewInstance(long size, string sopClassUid = "1.2.840.10
103103
{
104104
pixelData.AddFrame(new MemoryByteBuffer(GeneratePixelData(Rows, Columns)));
105105
}
106-
_outputHelper.WriteLine($"DICOM Instance created with {frames} frames.");
107106
return new DicomFile(dataset);
108107
}
109108

tests/Integration.Test/Features/DicomDimseScp.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ Feature: DICOM DIMSE SCP Services
4646
| CT | 1 |
4747
| MG | 2 |
4848
| US | 1 |
49-
# | TOMO | 1 |
5049

5150
@messaging_workflow_request @messaging
5251
Scenario Outline: Respond to C-STORE-RQ and group data by Series Instance UID
@@ -64,4 +63,3 @@ Feature: DICOM DIMSE SCP Services
6463
| CT | 1 | 2 |
6564
| MG | 1 | 3 |
6665
| US | 1 | 2 |
67-
# | TOMO | 1 | 2 |

tests/Integration.Test/Features/DicomDimseScp.feature.cs

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Integration.Test/Features/DicomDimseScu.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ Feature: DICOM DIMSE SCU Services
3232
| MG | 1 |
3333
| US | 1 |
3434
| Tiny | 1 |
35-
# | TOMO | 1 |

tests/Integration.Test/Features/DicomWebExport.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ Feature: DICOMweb Export Service
3030
| MG |
3131
| US |
3232
| Tiny |
33-
# | TOMO |

tests/Integration.Test/Monai.Deploy.InformaticsGateway.Integration.Test.csproj

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@
3939
<ProjectReference Include="..\..\src\DicomWebClient\Monai.Deploy.InformaticsGateway.DicomWeb.Client.csproj" />
4040
</ItemGroup>
4141

42-
<ItemGroup>
43-
<None Update="appsettings.json">
44-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
45-
</None>
46-
<None Update="study.json">
47-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
48-
</None>
49-
</ItemGroup>
50-
42+
<Target Name="CopyTestConfigurations" AfterTargets="AfterBuild">
43+
<PropertyGroup>
44+
<STUDYJSON Condition=" '$(STUDYJSON)' == '' ">study.json</STUDYJSON>
45+
</PropertyGroup>
46+
<Message Importance="High" Text="Copying $(STUDYJSON) to $(OutDir)" />
47+
<Copy OverwriteReadOnlyFiles="true" SourceFiles="appsettings.json" DestinationFolder="$(OutDir)" />
48+
<Copy OverwriteReadOnlyFiles="true" SourceFiles="$(STUDYJSON)" DestinationFiles="$(OutDir)\study.json" />
49+
</Target>
5150
</Project>

tests/Integration.Test/run.sh

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ EXIT=false
2020
METRICSFILE=$SCRIPT_DIR/metrics.log
2121
LOADDEV=
2222
STREAMID=
23+
export STUDYJSON="study.json"
2324

2425
export DATA_PATH="$RUN_DIR/ig/payloads/"
2526
set -euo pipefail
@@ -43,10 +44,17 @@ function check_status_code() {
4344
}
4445

4546
function env_setup() {
47+
[ -d $RUN_DIR ] && info "Removing $RUN_DIR..." && sudo rm -r $RUN_DIR
48+
mkdir -p $RUN_DIR
49+
50+
[ -d $BIN_DIR ] && info "Removing $BIN_DIR..." && sudo rm -r $BIN_DIR
51+
4652
set +u
47-
if [ "$1" = "--dev" ] ; then
53+
if [ "$1" = "--dev" ]; then
4854
info "Using .env.dev..."
4955
LOADDEV="--env-file .env.dev"
56+
info "Using study.json.dev..."
57+
STUDYJSON="study.json.dev"
5058
fi
5159
set -u
5260

@@ -55,37 +63,25 @@ function env_setup() {
5563
docker-compose $LOADDEV down
5664
fi
5765

58-
if (dotnet tool list --global | grep livingdoc &>/dev/null) ; then
66+
if (dotnet tool list --global | grep livingdoc &>/dev/null); then
5967
info "Upgrading SpecFlow.Plus.LivingDoc.CLI..."
6068
dotnet tool update --global SpecFlow.Plus.LivingDoc.CLI
6169
else
6270
info "Installing SpecFlow.Plus.LivingDoc.CLI..."
6371
dotnet tool install --global SpecFlow.Plus.LivingDoc.CLI
6472
fi
65-
66-
[ -d $RUN_DIR ] && info "Removing $RUN_DIR..." && sudo rm -r $RUN_DIR
67-
mkdir -p $RUN_DIR
68-
69-
[ -d $BIN_DIR ] && info "Removing $BIN_DIR..." && sudo rm -r $BIN_DIR
7073
}
7174

7275
function build() {
7376
pushd $SCRIPT_DIR
7477
info "Building test runner..."
7578
dotnet build -c Release
76-
77-
# info "Copying config files..."
78-
# cp -vf $CONFIG_DIR/*.* $BIN_DIR/
79-
# cp -vf $SCRIPT_DIR/configs/test-runner.json $BIN_DIR/SpecFlowPlusRunner/net5.0/appsettings.json
80-
# cp -vf $BIN_DIR/libe_sqlite3.so $BIN_DIR/SpecFlowPlusRunner/net5.0/
81-
popd
8279
}
8380

8481
function start_services() {
8582
info "Starting dependencies docker-compose $LOADDEV up -d --force-recreate..."
8683
docker-compose $LOADDEV up -d --force-recreate
8784

88-
8985
HOST_IP=$(docker network inspect testrunner | jq -r .[0].IPAM.Config[0].Gateway)
9086
info "Host IP = $HOST_IP"
9187
export HOST_IP
@@ -115,8 +111,8 @@ function write_da_metrics() {
115111
info "Streaming Informatics Gateway perf logs from container $CID to $METRICSFILE"
116112

117113
until $EXIT; do
118-
DATA=$(docker stats $CID --no-stream --format "`date +%s`,{{.CPUPerc}},{{.MemUsage}},{{.NetIO}},{{.BlockIO}}")
119-
echo $DATA >> $METRICSFILE
114+
DATA=$(docker stats $CID --no-stream --format "$(date +%s),{{.CPUPerc}},{{.MemUsage}},{{.NetIO}},{{.BlockIO}}")
115+
echo $DATA >>$METRICSFILE
120116
sleep 1
121117
done
122118
}
@@ -150,7 +146,7 @@ function generate_reports() {
150146

151147
function save_logs() {
152148
info "Saving service log..."
153-
docker-compose logs --no-color -t | sort -u -k 3 > "services.log"
149+
docker-compose logs --no-color -t | sort -u -k 3 >"services.log"
154150
}
155151

156152
function tear_down() {

tests/Integration.Test/study.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
"MR": {
33
"seriesMin": 1,
44
"seriesMax": 2,
5-
"instanceMin": 64,
6-
"instanceMax": 128,
5+
"instanceMin": 2,
6+
"instanceMax": 4,
77
"sizeMin": 0.36,
88
"sizeMax": 2
99
},
1010
"CT": {
1111
"seriesMin": 1,
1212
"seriesMax": 2,
13-
"instanceMin": 60,
14-
"instanceMax": 1000,
13+
"instanceMin": 2,
14+
"instanceMax": 4,
1515
"sizeMin": 0.5,
1616
"sizeMax": 1
1717
},
@@ -21,31 +21,31 @@
2121
"instanceMin": 1,
2222
"instanceMax": 1,
2323
"sizeMin": 5,
24-
"sizeMax": 75
24+
"sizeMax": 10
2525
},
2626
"TOMO": {
2727
"seriesMin": 4,
2828
"seriesMax": 8,
2929
"instanceMin": 1,
3030
"instanceMax": 1,
31-
"sizeMin": 300,
32-
"sizeMax": 750
31+
"sizeMin": 3,
32+
"sizeMax": 8
3333
},
3434
"US": {
3535
"seriesMin": 1,
3636
"seriesMax": 4,
3737
"instanceMin": 1,
3838
"instanceMax": 1,
39-
"sizeMin": 25,
40-
"sizeMax": 100
39+
"sizeMin": 2,
40+
"sizeMax": 5
4141
},
4242
"Pathology": {
4343
"seriesMin": 1,
4444
"seriesMax": 4,
4545
"instanceMin": 1,
4646
"instanceMax": 1,
47-
"sizeMin": 10000,
48-
"sizeMax": 20000
47+
"sizeMin": 10,
48+
"sizeMax": 20
4949
},
5050
"Tiny": {
5151
"seriesMin": 1,

tests/Integration.Test/study.json.dev

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"MR": {
3+
"seriesMin": 1,
4+
"seriesMax": 2,
5+
"instanceMin": 64,
6+
"instanceMax": 128,
7+
"sizeMin": 0.36,
8+
"sizeMax": 2
9+
},
10+
"CT": {
11+
"seriesMin": 1,
12+
"seriesMax": 2,
13+
"instanceMin": 60,
14+
"instanceMax": 1000,
15+
"sizeMin": 0.5,
16+
"sizeMax": 1
17+
},
18+
"MG": {
19+
"seriesMin": 4,
20+
"seriesMax": 8,
21+
"instanceMin": 1,
22+
"instanceMax": 1,
23+
"sizeMin": 5,
24+
"sizeMax": 75
25+
},
26+
"TOMO": {
27+
"seriesMin": 4,
28+
"seriesMax": 8,
29+
"instanceMin": 1,
30+
"instanceMax": 1,
31+
"sizeMin": 300,
32+
"sizeMax": 750
33+
},
34+
"US": {
35+
"seriesMin": 1,
36+
"seriesMax": 4,
37+
"instanceMin": 1,
38+
"instanceMax": 1,
39+
"sizeMin": 25,
40+
"sizeMax": 100
41+
},
42+
"Pathology": {
43+
"seriesMin": 1,
44+
"seriesMax": 4,
45+
"instanceMin": 1,
46+
"instanceMax": 1,
47+
"sizeMin": 10000,
48+
"sizeMax": 20000
49+
},
50+
"Tiny": {
51+
"seriesMin": 1,
52+
"seriesMax": 1,
53+
"instanceMin": 1,
54+
"instanceMax": 1,
55+
"sizeMin": 1,
56+
"sizeMax": 2
57+
}
58+
}

0 commit comments

Comments
 (0)