Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add note for REST integration tests

...

(warning) please take this into consideration if you find yourself creating many templates that have no purpose other than holding the test description: in the future, the current website.properties file might be specialized (i.e use a custom, simpler, format, instead of the properties import format; additionally, the test description might figure in there instead of the template, especially for tests where templating isn't relevant); if you're in such case, feel free to do so yourself or give us a shout!

We have also provided "integration tests" for REST.

  • Check out - https://git.magnolia-cms.com/scm/modules/rest.git
  • We use Rest Assured to easy to test our API. See more syntax in its documentation https://github.com/rest-assured/rest-assured
  • Add new integration tests under the path  /magnolia-rest-integration-tests/tests/src/test/java
  • Launch the container by using "manual-test" profile: mvn clean verify -Pjetty9-standalone,manual-tests
  • Want to put some bootstrap dummy data? Put them under the folder  /magnolia-rest-integration-tests/magnolia-rest-test-webapp/src/main/webapp/WEB-INF/bootstrap/common
  • In order to add more endpoints or override endpoint configuration. Find the configuration in the folder /magnolia-rest-integration-tests/magnolia-rest-test-webapp/src/main/webapp/modules/rest-content-delivery/restEndpoints

Automated tests

We also have a suite of automated tests. They rely on the same process, but are executed differently:

...

REST integration tests will be executed everytime the REST module is built - https://jenkins.magnolia-cms.com/job/m_rest/configure

Concurrent builds for bundles on Jenkins

...

(warning) When branching a bundle's master to the next major version, one should update these ports according to the pattern in the table above. 


The REST integration test web-app is not depend on CE bundle. It's a standalone web-app. 

Reserved ports for REST integration tests web-app is configured in: /rest/magnolia-rest-integration-tests/tests/pom.xml

<containerHttpPort>8496</containerHttpPort>
<cargoRmiPort>8495</cargoRmiPort>
<cargoTomcatAjpPort>8494</cargoTomcatAjpPort>

Debugging

To debug these tests, one way to go is to start the container the same way as for the manual tests, with mvn clean verify -Pmanual-tests, and run the tests from the IDE in debug mode.
Somehow, memory issues seem to arise, at least with EE, in the manual-tests mode. This seemed to have helped, not sure which statement exactly:

...