Verigreen SystemTests - Verigreen/verigreen GitHub Wiki
#Configure Testing Environment To run system test on Evergreen, you will need to configure maven on that system. All test should be run when collector is up and running. After cloning EG repository, the system test properties file should be modified and can be found in the path: /evergreen-root/evergreen-collector-system-tests/test-resources/system-tests.properties the following fields should be modified:
collector.address=http://collector.host:collector.port/rest // address to the collector
branch.master=master # The name of the 'master' branch
user.git.repository=C:\\Users\\borza\\workspace\\playground\\repo_test\\mircea_test\\.git # the user simulation git repository path. Example: P:/system-tests/repositories/user/lital/.git
refs.heads=refs/heads/ # path to the local branches 'heads' in git, # path to the remote branches in git, including the ending '/' including the ending '/'
refs.remotes=refs/remotes/origin/ # path to the remote branches in git, including the ending '/'
After modifying the fields, the system-tests.properties should be copied to VG_HOME path - more on this path can be found in the Verigreen Deployment page.
#Executing Test System test can be found on two major files: /evergreen-collector-system-tests/utest/com/hp/evergreen/collector/systemtest/TestCollectorE2EGreenPath.java /evergreen-collector-system-tests/utest/com/hp/evergreen/collector/systemtest/TestCollectorE2EFailures.java Each file is divided to tests. All tests can be run under the file or a specific test can be run individually. To execute the test, use one of the following command:
mvn –Dtest=TestCollectorE2Efailures test //will run all test under this file
mvn -Dtest=TestClass#testMethod1+testMethod2+…+testMethodn test //will run specific tests
###Tests List The following tests are available for ST. All tests was reviewed and tested thoroughly:
testSimpleCommit()
- user1 creates new file -> commit+push collector+git verification
testSimpleCommitMultipleBranches()
- user creates new file on several branches, and checks that all committed well and in the correct branches
testPermittedUser()
- a permitted user pushes and bypass EG.
testSimpleMerge()
- User 1 creates file1 and file2 and writes 1 line in each file -> commit+push wait until verification for the commit is finished user 2 adds another line to file1 -> commit+push user 3 adds another line to file2 -> commit+push collector verification for the commit of user2, collector+git verification for the commit of user3.
permittedUserPushWhileJobIsRunning()
- User 1 commits and pushes to the master branch User 2 (permitted user) also pushes to the master branch while the job of user A is running Because User 2 is a permitted user, his commit will be rejected by evergreen and will be pushed to the repository directly.
testSimpleMergeMultipleBranches()
- User 1 creates file1 and file2 and writes 1 line in each file -> commit+push wait until verification for the commit is finished user 2 adds another line to file1 -> commit+push user 3 adds another line to file2 -> commit+push collector verification for the commit of user2 collector+git verification for the commit of user3. This happens on multiple branches.
test5Users()
- 5 users pushing 4 files.
test5UsersMultipleBranches()
- User 1 commits 4 different files in 3 branches. Then other 4 users change each different file in all the branches. All should be merged in correct branches.
testRetryTriggerFailed()
- Testing the retry in case of a trigger failure. An invalid username is specified, the branch is committed and pushed, asserted as failed with the TRIGGER FAILURE status. Then the same commit id is pushed again with a valid user and asserted as PASSED AND PUSHED.
test5UsersWithMergeFailureMultipleBranches()
- User 1 commits 4 different files in 3 branches. Users 2 and 3 update file number 1 simultaneously in the same row for 3 branches. Users 4 and 5 update each different files in 3 branches. User 3 should receive FAIL_MERGE and all the rest should be committed and pushed successfully
test5UsersWithMergeFailure()
.
testCommiterNameChangesInRT()
- Testing change of commiter name in real time. using real properties form collector config.properties
testProtectedBranchesChangesInRT()
- Testing change of protected branch in real time. user1 creates new file -> commit+push collector+git verification using real properties form collector config.properties
testPermittedUsersChangesInRT()
.
testMergeFailureMultipleBranches()
- User 1 commits and pushes one file. User 2 adds a line in the same file at the beginning, and user 3 adds a line at the end. Both users are committing and pushing. Failure should occur. All this in 3 branches.
testMergeFailure()
.