Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance 27 functional tests for travis #30

Merged
merged 50 commits into from
Sep 3, 2018

Conversation

grantmacken
Copy link
Contributor

@grantmacken grantmacken commented Aug 31, 2018

This is a rework or .travis.yml for issue #27
See last build on travis-ci

The following smoke tests are carried out on a running container instance of a freshly minted image
The container is brought up with docker-composer

  • check eXist is starting with health status
  • a timeout wait until eXist can be reached on port 8080
  • after sleeping for 30 sec the health-check should register healthy

The following functional test checks are carried out on the first travis job stage

  • changing password with client.jar
    checks the ability to
    - invoke client.jar
    - change password
    - query db with new pass
    test: after changing password the is-dba() query call should return true

  • obtain running container eXist 'version'
    checks the ability to
    - invoke a http client (curl)
    - use GET to query the database
    test: the get-version() query, should match the version of the freshly minted built image

  • posting requests to rest endpoint url via CURL
    checks the ability to
    - invoke a http client (curl)
    - query the database by POSTing a query
    test: the list returned from a repo:list() query, should grep 'http://'

  • manage config files
    check the ability to
    - copy a config file from container to local disk
    test: after copying conf.xml the file should exist locally

  • persist changed configuration items
    checks the abilty to
    - alter a config item in a config file on local disk,
    - copy the altered config file into containers config dir.
    - stop and start the container
    - view changed item taking effect in startup logs
    test: the startup log should show altered shutdown time

  • log to docker logs
    checks the abilty to
    - call log functions
    - view results in docker logs
    test: eXist log queries output should turn up in docker logs

The main aim was to add run-time functional tests,
that tests what we have altered in eXist specifically for the container image

#27 issue Items not covered in this pull request

  • make sure that dashboard is accessible (based on experience healthcheck is not enough for this)
  • Ideally we would check that no ERROR messages appear in the log after startup

@adamretter
Copy link
Member

Wow quite comprehensive.

I wonder if it would be worth splitting this into install and script steps - https://docs.travis-ci.com/user/customizing-the-build/#the-build-lifecycle

Also, perhaps it is better to extract the shell scripts from .travis.yml into a separate shell script. With a separate shell script, we can then also run the tests locally, and we can easily check and validate any syntax errors.

Copy link
Contributor

@duncdrum duncdrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool PR thank you grant.
I think this is good to merge, we need to run three sequential installs for the smoke tests, we can make further tweaks to get the functional tests to run in parallel at a later time

@duncdrum duncdrum merged commit 98964e0 into develop Sep 3, 2018
@duncdrum duncdrum deleted the enhance-27-functional-tests-for-travis branch September 3, 2018 19:57
@grantmacken grantmacken mentioned this pull request Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants