Skip to content

Commit 9998d70

Browse files
committed
Sync/cdr 280 create bom (ehrbase#820)
1 parent 125f6a1 commit 9998d70

File tree

9 files changed

+551
-397
lines changed

9 files changed

+551
-397
lines changed

.circleci/config.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,7 @@ commands:
12781278
# - cache-out-python-requirements
12791279
- install-maven
12801280
- install-python3-requirements
1281+
- install-xml-cli-tool
12811282
# - run: jps
12821283
# - run:
12831284
# name: Wait until EHRbase server is ready
@@ -1293,7 +1294,8 @@ commands:
12931294
echo "OAUTH_RESRCSERVER_URL: $SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUERURI"
12941295
ls -la
12951296
if [ "${SUT}" != "TEST" ]; then
1296-
EHRbase_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)
1297+
1298+
EHRbase_VERSION=$(xmlstarlet sel -t -m "/_:project/_:version" -v . pom.xml )
12971299
echo ${EHRbase_VERSION}
12981300
java -jar "application/target/application-${EHRbase_VERSION}.jar" \
12991301
--system.allow-template-overwrite=<< parameters.allow-template-overwrite >> \
@@ -1447,32 +1449,35 @@ commands:
14471449

14481450
maven-install-sdk:
14491451
steps:
1452+
- install-xml-cli-tool
14501453
- run:
14511454
name: Save the version number of locally installed SDK into a file
14521455
command: |
14531456
cd ~/projects/openEHR_SDK
1454-
mvn build-helper:parse-version versions:set -DnewVersion=\${project.version}-LOCAL$(cat /proc/sys/kernel/random/uuid) versions:commit
1455-
SDK_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)
1457+
mvn build-helper:parse-version versions:set -DnewVersion=\${project.version}-LOCAL$(cat /proc/sys/kernel/random/uuid) -DprocessAllModules=true versions:commit
1458+
1459+
SDK_VERSION=$(xmlstarlet sel -t -m "/_:project/_:version" -v . pom.xml )
14561460
echo $SDK_VERSION > SDK_VERSION
14571461
cat SDK_VERSION
14581462
- run:
14591463
name: INSTALL SDK
14601464
command: |
14611465
cd ~/projects/openEHR_SDK
1462-
mvn install -Dmaven.javadoc.skip=true -Djacoco.skip=true -Dmaven.test.skip
1463-
1464-
1466+
mvn install -Dmaven.javadoc.skip=true -Djacoco.skip=true -Dmaven.test.skip
1467+
1468+
14651469
start-ehrbase-and-run-java-integration-sdk-tests:
14661470
description: |
14671471
Starts ehrbase server and runs maven test phase using 'slow' profile defined in parent pom.xml
14681472
This way only the Java integration tests are executed.
14691473
steps:
1474+
- install-xml-cli-tool
14701475
- run:
14711476
name: Start EHRbase server and run SDK's java integration tests
14721477
command: |
14731478
ls -la
14741479
cd ~/projects
1475-
EHRbase_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)
1480+
EHRbase_VERSION=$(xmlstarlet sel -t -m "/_:project/_:version" -v . pom.xml )
14761481
echo ${EHRbase_VERSION}
14771482
java -jar application/target/application-${EHRbase_VERSION}.jar --cache.enabled=true --plugin-manager.enable=true --plugin-manager.plugin-dir='tests/test_plugin' --plugin-manager.plugin-config-dir='tests/test_plugin_config_dir'> log &
14781483
grep -m 1 "Started EhrBase in" <(tail -f log)
@@ -1488,11 +1493,13 @@ commands:
14881493
This requires EHRbase + DB to be running during test execution.
14891494
steps:
14901495
- install-maven
1496+
- install-xml-cli-tool
14911497
- run:
14921498
name: Start EHRbase server and run all test of SDK
14931499
command: |
14941500
ls -la
1495-
EHRbase_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)
1501+
1502+
EHRbase_VERSION=$(xmlstarlet sel -t -m "/_:project/_:version" -v . pom.xml )
14961503
echo ${EHRbase_VERSION}
14971504
cd ~/projects # NOTE: This is where the target folder w/ artifacts were persisted to in previous step.
14981505
java -javaagent:/home/circleci/jacoco/lib/jacocoagent.jar=output=tcpserver,address=127.0.0.1 \
@@ -1646,12 +1653,12 @@ commands:
16461653
SDK_VERSION=$(cat ~/projects/openEHR_SDK/SDK_VERSION)
16471654
echo $SDK_VERSION
16481655
# cd ~/projects
1649-
xmlstarlet edit --inplace -u /_:project/_:properties/_:ehrbase.sdk.version -v $SDK_VERSION pom.xml
1656+
xmlstarlet edit --inplace -u /_:project/_:properties/_:ehrbase.sdk.version -v $SDK_VERSION bom/pom.xml
16501657
- run:
16511658
name: Show EHRbase's pom
1652-
command: cat pom.xml
1659+
command: cat bom/pom.xml
1660+
16531661

1654-
16551662
build-and-test-ehrbase:
16561663
steps:
16571664
# - install-maven
@@ -1665,12 +1672,14 @@ commands:
16651672
start-ehrbase-server:
16661673
steps:
16671674
- install-maven
1675+
- install-xml-cli-tool
16681676
- run:
16691677
name: Start EHRbase server and wait for it to be ready
16701678
background: true
16711679
command: |
16721680
ls -la
1673-
EHRbase_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)
1681+
1682+
EHRbase_VERSION=$(xmlstarlet sel -t -m "/_:project/_:version" -v . pom.xml )
16741683
echo ${EHRbase_VERSION}
16751684
java -jar application/target/application-${EHRbase_VERSION}.jar --cache.enabled=true --plugin-manager.enable=true --plugin-manager.plugin-dir='tests/test_plugin' --plugin-manager.plugin-config-dir='tests/test_plugin_config_dir' > log &
16761685
grep -m 1 "Started EhrBase in" <(tail -f log)

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1010
### Added
1111

1212
- Implement template example endpoints ([#801](https://github.com/ehrbase/openEHR_SDK/pull/801))
13-
- Implement EHR_STATUS.is_modifiable semantics on service level ([#791](https://github.com/ehrbase/openEHR_SDK/pull/791))
13+
- Implement EHR_STATUS.is_modifiable semantics on service
14+
level ([#791](https://github.com/ehrbase/openEHR_SDK/pull/791))
15+
- use bom for dependence management ([#820](https://github.com/ehrbase/ehrbase/pull/820))
1416

1517
### Changed
1618
- Upgrade to Spring boot 2.5.12

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ COPY ./rest-openehr/pom.xml ./rest-openehr/pom.xml
5252
COPY ./service/pom.xml ./service/pom.xml
5353
COPY ./test-coverage/pom.xml ./test-coverage/pom.xml
5454
COPY ./plugin/pom.xml ./plugin/pom.xml
55-
RUN mvn dependency:go-offline -B
55+
COPY ./bom/pom.xml ./bom/pom.xml
56+
# RUN mvn dependency:go-offline -B
5657

5758
# COPY SOURCEFILES
5859
COPY ./api/src ./api/src
@@ -63,10 +64,10 @@ COPY ./rest-ehr-scape/src ./rest-ehr-scape/src
6364
COPY ./rest-openehr/src ./rest-openehr/src
6465
COPY ./service/src ./service/src
6566
COPY ./plugin/src ./plugin/src
66-
RUN mvn compile dependency:go-offline \
67-
-Dflyway.skip=true \
68-
-Djooq.codegen.skip=true \
69-
-Dmaven.main.skip
67+
#RUN mvn compile dependency:go-offline \
68+
# -Dflyway.skip=true \
69+
# -Djooq.codegen.skip=true \
70+
# -Dmaven.main.skip
7071

7172
# START DB AND COMPILE EHRBASE
7273
RUN su - postgres -c "pg_ctl -D ${PGDATA} -w start" && \

api/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,6 @@
7373
<scope>test</scope>
7474
</dependency>
7575
</dependencies>
76+
77+
7678
</project>

application/src/test/java/org/ehrbase/application/abac/AbacIntegrationTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,33 @@
4343
import org.ehrbase.test_data.composition.CompositionTestDataCanonicalJson;
4444
import org.ehrbase.test_data.operationaltemplate.OperationalTemplateTestData;
4545
import org.junit.jupiter.api.Assertions;
46+
import org.junit.jupiter.api.Disabled;
4647
import org.junit.jupiter.api.Test;
47-
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
48-
import org.junit.runner.RunWith;
4948
import org.springframework.beans.factory.annotation.Autowired;
49+
import org.springframework.boot.info.BuildProperties;
5050
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
5151
import org.springframework.boot.test.context.SpringBootTest;
5252
import org.springframework.boot.test.mock.mockito.MockBean;
5353
import org.springframework.http.HttpStatus;
5454
import org.springframework.http.MediaType;
5555
import org.springframework.security.oauth2.core.user.OAuth2UserAuthority;
5656
import org.springframework.test.context.ActiveProfiles;
57-
import org.springframework.test.context.junit4.SpringRunner;
5857
import org.springframework.test.web.servlet.MockMvc;
5958
import org.springframework.test.web.servlet.MvcResult;
6059
import org.springframework.util.ResourceUtils;
6160

62-
@RunWith(SpringRunner.class)
6361
@SpringBootTest
6462
@ActiveProfiles({"local", "test"})
65-
@EnabledIfEnvironmentVariable(named = "EHRBASE_ABAC_IT_TEST", matches = "true")
63+
// @EnabledIfEnvironmentVariable(named = "EHRBASE_ABAC_IT_TEST", matches = "true")
6664
@AutoConfigureMockMvc
65+
@Disabled("see https://jira.vitagroup.ag/browse/CDR-368")
6766
class AbacIntegrationTest {
6867

6968
private static final String ORGA_ID = "f47bfc11-ec8d-412e-aebf-c6953cc23e7d";
7069

7170
@MockBean
7271
private AbacConfig.AbacCheck abacCheck;
72+
@MockBean private BuildProperties buildProperties;
7373

7474
@Autowired
7575
private MockMvc mockMvc;
@@ -78,9 +78,10 @@ class AbacIntegrationTest {
7878
private AbacConfig abacConfig;
7979

8080
@Test
81-
/*
82-
* This test requires a new and clean DB state to run successfully.
83-
*/
81+
/*
82+
* This test requires a new and clean DB state to run successfully.
83+
*/
84+
8485
void testAbacIntegrationTest() throws Exception {
8586
/*
8687
----------------- TEST CONTEXT SETUP -----------------

application/src/test/java/org/ehrbase/application/cors/CorsBasicAuthIT.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
package org.ehrbase.application.cors;
22

3+
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options;
4+
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
5+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
6+
37
import org.junit.jupiter.api.Test;
48
import org.springframework.beans.factory.annotation.Autowired;
59
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
610
import org.springframework.boot.test.context.SpringBootTest;
711
import org.springframework.test.web.servlet.MockMvc;
812

9-
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options;
10-
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
11-
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
12-
13-
@SpringBootTest(properties = {
14-
"security.authType=basic",
15-
"spring.cache.type=simple"
16-
})
13+
@SpringBootTest(properties = {"security.authType=basic", "spring.cache.type=simple"})
1714
@AutoConfigureMockMvc
1815
class CorsBasicAuthIT {
1916

application/src/test/java/org/ehrbase/application/cors/CorsNoAuthIT.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
package org.ehrbase.application.cors;
22

3+
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options;
4+
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
5+
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
6+
37
import org.junit.jupiter.api.Test;
48
import org.springframework.beans.factory.annotation.Autowired;
59
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
610
import org.springframework.boot.test.context.SpringBootTest;
711
import org.springframework.test.web.servlet.MockMvc;
812

9-
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options;
10-
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
11-
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
12-
13-
@SpringBootTest(properties = {
14-
"spring.cache.type=simple"
15-
})
13+
@SpringBootTest(properties = {"spring.cache.type=simple"})
1614
@AutoConfigureMockMvc
1715
class CorsNoAuthIT {
1816

0 commit comments

Comments
 (0)