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

New integration tests #1104

Closed
helkv opened this issue Jan 24, 2019 · 1 comment

Comments

@helkv
Copy link

commented Jan 24, 2019

Ticket for the development of the new Imeji integration tests.

Reasons for the development of new integration tests:

  • The existing integration tests were not executed for a long time
    • some of them were not up to date and did not run any more
  • Embedded Elasticsearch, which some tests rely on, is not supported in the new Elasticsearch version any more
  • After major changes in Imeji a new testing approach and test setup is needed

Steps for the creation of the new integration tests setup:

  1. Analysation of the existing integration tests and their structure
  2. Handling of the existing integration tests
    1. Deletion of existing tests which are out dated and in a bad condition
    2. Refactoring of existing tests which are in good condition and fit in the new test setup
    3. Continue to use (parts of) existing tests which are in good condition and still run successfully
  3. Reimplementation of the Elasticsearch access within the tests
  4. Implementation of the new integration tests, on basis of the new Imeji architecture and the new testing approach

@helkv helkv added the enhancement label Jan 24, 2019

@helkv helkv self-assigned this Jan 24, 2019

helkv added a commit that referenced this issue Jan 24, 2019
#1104 Tests are compiled again
- The test classes are compiled again
- Running the tests is still skipped (until tests are fixed or new are
added)
- Removed the access to ElasticInitializer from the test super class
(alternative to Embedded Elastic has to be implemented/configured
instead)
helkv pushed a commit that referenced this issue Mar 15, 2019
helk helk
#1104 Add Testcontainers Elasticsearch library
-> Use Testcontainers (Elasticsearch Module) to start Elasticsearch in a
Docker Container for the integration tests
- Add ElasticsearchTestUtil class to start and stop the
ElasticsearchContainer
helkv pushed a commit that referenced this issue Mar 15, 2019
helk helk
#1104 Apply Elasticsearch Testcontainers in the integration tests
-> Use ElasticsearchTestUtil to start/stop Elasticsearch in a Docker
Container before/after the integration tests
- Remove SuperTestSuite
- Update jersey (REST) dependencies to solve dependency conflict
(referring to javax.servlet-api) occurring in the integration tests
helkv pushed a commit that referenced this issue Mar 15, 2019
helk helk
#1104 Remove javaee-api dependency
-> Eclipse wrongly shows 'The import ... cannot be resolved' error
messages for multiple dependencies (i.a. javax.ws.rs...), when
javaee-api dependency is present
-> javaee-api not required (covered by other dependencies)
helkv added a commit that referenced this issue Mar 22, 2019
#1104 Run integration tests in Maven builds
-> Run the integration tests (using docker for elasticsearch) when
building Imeji with Maven
- set skipTests false
helkv added a commit that referenced this issue Apr 23, 2019
#1104 Temporarily skip PdfHandlingTest
- On jenkins an IOException occurs in the PdfHandlingTest (locally the
test runs successfully)
- Skip the PdfHandlingTest, until Test/IOException is fixed
helkv added a commit that referenced this issue Apr 26, 2019
#1104 Fix and Edit of the loading mechanism of the properties files
- Edit the PropertyReader
1) Load the imeji.properties from the server conf directory if a server
is detected
2) Throw a FileNotFoundException if a server is detected but the
imeji.properties is not found in the server conf directory
3) Load the imeji.properties from classpath if no server is detected
4) Throw a FileNotFoundException if no server is detected and the
imeji.properties is not found in the classpath

- Renamed solution.properties to version.properties
- Removed appname property from the version.properties
- Removed setting the catalina.base system property in the pom.xml
helkv added a commit that referenced this issue Jun 19, 2019
#1104 Update Elasticsearch docker image
- Set the Elasticsearch docker image name to Elasticsearch version 7.0.1
(after merging with the latest imeji version which uses Elasticsearch
7.0.1)
helkv added a commit that referenced this issue Jun 28, 2019
#1104 Update test classes due to changes made for ticket 1122
-> The local test User objects have to be retrieved after creating a
collection (because the side effect that the user objects (with
user-grants) passed to the method get updated is removed!)
-> The stored test User objects have to be updated
(UserService.update()) after changing the grants of the local test user
(because the user now gets retrieved within the
ShareService.shareToUser()/shareToGroup() methods!)

- Updated test classes: ContentServiceTest, FileAuthorizationTest,
ShareServiceTest, StatementServiceTest, SuperServiceTest,
UserServiceTest
helkv added a commit that referenced this issue Jun 28, 2019
#1104 Add new test classes
- Add new test classes (to be extended by more test methods):
CollectionServiceCreateTest, StatementServiceUpdateTest
helkv added a commit that referenced this issue Jul 5, 2019
#1104 Add new test classes to SuiteClass
-> So that new test classes are being executed they have to be added to
the corresponding suite classes for now.
- Add CollectionServiceCreateTest and StatementServiceUpdateTest to
ServiceTestSuite
helkv added a commit that referenced this issue Jul 5, 2019
#1104 Delete the test files 'tmp' directory
-> Delete the test files 'tmp' directory before and after each test
class
- Add deleteTempDirectory() method to JenaUtil class

@haarli haarli added this to To do in imeji 4.6 Jul 8, 2019

helkv added a commit that referenced this issue Jul 8, 2019
#1104 Update/Fix test classes due to changes made for ticket 1122 (II)
-> The local test User objects have to be retrieved after creating a
collection (because the side effect that the user objects (with
user-grants) passed to the method get updated is removed!)
-> So that new test classes are being executed they have to be added to
the corresponding suite classes for now.

- Updated & Fixed test classes: CollectionServiceTest, ItemServiceTest
- Re-add CollectionServiceTest and ItemServiceTest to ServiceTestSuite

@helkv helkv moved this from To do to In progress in imeji 4.6 Jul 9, 2019

helkv added a commit that referenced this issue Jul 11, 2019
#1104 Update the deletion of the test files directories
- Delete the test files directories (before and) after each test class
in JenaUtil.closeJena()
- Log the deletion of the different test files directories
helkv added a commit that referenced this issue Jul 12, 2019
#1104 Change sequence of test files deletion methods
- Changed the order of the deletion methods in JenaUtil: delete tmp
directory before files directory
helkv added a commit that referenced this issue Jul 12, 2019
#1104 Temporarily skip test execution
-> Skip integration tests execution until:
-> all tests that fail from time to time are fixed
-> the integration tests execution is configured correctly (all
necessary tests are being executed + integration tests will be executed
e.g. only on jenkins)

- set skipTests true
helkv added a commit that referenced this issue Jul 31, 2019
#1104 Execute integration tests on Jenkins using mvn profile env-testing
- Refactor maven profiles in pom.xml
- Add new maven profile env-testing (used to run the tests on jenkins)
- Edit Jenkinsfile: Activate the env-testing profile for the imeji maven
build on Jenkins
helkv added a commit that referenced this issue Aug 1, 2019
#1104 Add ControllerTestSuite
- Add ControllerTestSuite so that the controller tests get executed
- Skip currently not running tests in: InvitationBusinessControllerTest,
RegistrationBusinessControllerTest and StatisticsControllerTestClass
helkv added a commit that referenced this issue Aug 8, 2019
#1104 Stop ignore failures during testing
=> From now on the war file is not builded if (integration) tests fail
- Remove testFailureIgnore = true
@helkv

This comment has been minimized.

Copy link
Author

commented Aug 19, 2019

Updated integration tests get executed on Jenkins with every imeji commit/build.

@helkv helkv moved this from In progress to Done in imeji 4.6 Aug 19, 2019

helkv added a commit that referenced this issue Aug 26, 2019
#1104 Report and Visualize integration test results on Jenkins
- Use JUnit Plugin to capture test reports used for reporting and
visualization of the test results in Jenkins
helkv added a commit that referenced this issue Aug 29, 2019
#1104 Update path variables: Save test data in the current directory
- Use path ./data/imeji_test to save data created during tests
(-> The content of the ./data folder is deleted at the end of the tests)

@helkv helkv closed this Sep 16, 2019

imeji 4.6 automation moved this from Done to Closed Sep 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1 participant
You can’t perform that action at this time.