Skip to content

Commit

Permalink
Merge pull request #40 from devatherock/fix-test-failure
Browse files Browse the repository at this point in the history
fix: Limited heap size in integration tests, to fix the OOM error
  • Loading branch information
devatherock authored May 29, 2023
2 parents 0cbd234 + efb92d6 commit 4a34710
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
integration_test:
machine:
image: ubuntu-2004:202010-01
image: ubuntu-2204:2023.04.2
steps:
- checkout
- attach_workspace:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [#30](https://github.com/devatherock/ldap-search-api/issues/30): Updated dockerhub readme in CI pipeline
- [#32](https://github.com/devatherock/ldap-search-api/issues/32): Built a multi-arch docker image
- Used a multi-arch base image
- [#39](https://github.com/devatherock/ldap-search-api/issues/39]: Limited heap size in integration tests, to fix the out of memory error

## [0.5.0] - 2023-05-24
### Added
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17.0.7_7-jre-ubi9-minimal
COPY build/libs/ldap-search-api-*-all.jar ldap-search-api.jar
EXPOSE 8080
CMD java -Dcom.sun.management.jmxremote -noverify ${JAVA_OPTS} -jar ldap-search-api.jar
CMD java -Dcom.sun.management.jmxremote ${JAVA_OPTS} -jar ldap-search-api.jar
3 changes: 2 additions & 1 deletion docker-compose-remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ services:
LDAP_HOST: ldaps://ldap.jumpcloud.com:636
LDAP_USERNAME: $JUMPCLOUD_USERNAME
LDAP_PASSWORD: $JUMPCLOUD_PASSWORD
LDAP_BASE_DN: $JUMPCLOUD_BASE_DN
LDAP_BASE_DN: $JUMPCLOUD_BASE_DN
JAVA_OPTS: '-Xmx640m'
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ services:
LDAP_HOST: ldap://localhost:33389
LDAP_USERNAME: cn=Directory Manager
LDAP_PASSWORD: testpwd
JACKSON_SERIALIZATION_INDENT_OUTPUT: 'true'
JACKSON_SERIALIZATION_INDENT_OUTPUT: 'true'
JAVA_OPTS: '-Xmx640m'
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import io.micronaut.test.extensions.spock.annotation.MicronautTest
* Integration test for additional endpoints
*/
@MicronautTest(propertySources = 'classpath:application-integration.yml', startApplication = false)
class AdditionalEndpointsIntegrationSpec extends AdditionalEndpointsSpec {
class AdditionalControllerIntegrationSpec extends AdditionalControllerSpec {
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public class LdapSearchController {
* @param baseDn
* @param filter
* @param limit
* @param attributes
* @param requiredAttrs
* @return the search results
* @throws NamingException
*/
@Get(value = "/search")
public HttpResponse<List<Map<String, Object>>> search(@Nullable @QueryValue(value = "base_dn") String baseDn,
@QueryValue String filter,
@Nullable @QueryValue(defaultValue = "0") int limit,
@Nullable @QueryValue(defaultValue = "0") Integer limit,
@Nullable @QueryValue(value = "attributes") List<String> requiredAttrs)
throws NamingException {
HttpResponse<List<Map<String, Object>>> response = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import spock.lang.Unroll
/**
* Test for additional endpoints like {@code /health}
*/
abstract class AdditionalEndpointsSpec extends Specification {
abstract class AdditionalControllerSpec extends Specification {

@Inject
@Client('${test.server.url}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import io.micronaut.test.extensions.spock.annotation.MicronautTest
* Unit test for additional endpoints
*/
@MicronautTest
class AdditionalEndpointsTestSpec extends AdditionalEndpointsSpec {
class AdditionalControllerTestSpec extends AdditionalControllerSpec {
}

0 comments on commit 4a34710

Please sign in to comment.