#49337 CI test - import
Closed: wontfix by mreynolds. Opened by sramling.

Description
Write (port tests from TET) import test suite.
Put the tests to suites/import/import_test.py


Adding bugzilla test cases for https://bugzilla.redhat.com/show_bug.cgi?id=1463204.

0001-CI-test-import-bugzilla-test-cases.patch

Metadata Update from @sramling:
- Custom field component adjusted to None
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None

Metadata Update from @sramling:
- Issue assigned to sramling

Metadata Update from @sramling:
- Custom field component adjusted to CI test - suites (was: None)
- Custom field origin adjusted to QE (was: None)
- Custom field reviewstatus adjusted to review (was: None)
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1463204
- Custom field type adjusted to task (was: None)
- Custom field version adjusted to 1.3.6 (was: None)
- Issue priority set to: normal
- Issue set to the milestone: CI test 1.0

Minor issue, this script is in the suites directory, and it uses a name that indicates it tests the import feature, however, this test is only checking a particular bug. So I feel it should go into the /tickets directory.

Or, keep it in the /suites directory, but use a different name for the script. Some name that indicates it's testing unusual scenarios/bugs. Then we can add other "unique" tests to the script in the future.

I just think we should reserve the name "import_test.py" for the "standard" import tests, and not for single bugs.

Perhaps I'm being premature, and you have plans to expand on import_test.py. Thoughts?

@sramling regarding test case:
I think it is better to leave a bugzilla link in the pagure only, not in the docstring.

Please, don't forget to use os.path.join:

ldif_file = ldif_dir + '/suffix_del1.ldif'

Use MappingTrees object for mapping tree operation. Legacy will be removed one day.

mapping_tree = 'cn="{}",cn=mapping tree,cn=config'.format(TEST_SUFFIX1)
topo.standalone.delete_s(mapping_tree)

In the docstring - "no server hang" - I think for the right grammar it should be "the server should not hang" or something like that.

Use just topo.standalone.restart(timeout=10) without any 'assert' or 'if not'. And we will fix that part in lib389 later. I think it should use restart-dirsrv wrapper.

@mreynolds I agree. I think it is better to divide the bugzilla special cases from the basic cases.
Also, @vashirov proposed to use pytest.marks, so we can run the tests for regressions only. I agree with that too. As an alternative, we can have the next structure and run 'py.test -k regression ./'

suites/import/basic_test.py
suites/import/regression_test.py
suites/replication/basic_test.py
suites/replication/cleanallruv_test.py
suites/replication/regression_test.py
etc.

Minor issue, this script is in the suites directory, and it uses a name that indicates it tests the import feature, however, this test is only checking a particular bug. So I feel it should go into the /tickets directory.
Or, keep it in the /suites directory, but use a different name for the script. Some name that indicates it's testing unusual scenarios/bugs. Then we can add other "unique" tests to the script in the future.
I just think we should reserve the name "import_test.py" for the "standard" import tests, and not for single bugs.
Perhaps I'm being premature, and you have plans to expand on import_test.py. Thoughts?
The plan is to port all the import tests from TET to Pytest.

Personally I feel we should break up the tests into different files. One for core import tests, (import_test.py), and ones for different types of tests as previously mentioned by Simon.

Breaking up the tests into different scripts also makes things easier in some regards, because using one file for every test means that some tests might also need to "reset" the server before the next test function runs.

@mreynolds and @spichugi , thanks for your input. It makes sense to split the tests into different scripts. Here is my new patch...

0001-CI-test-import-bugzilla-test-cases.patch

Adding new patch

0001-CI-test-import-bugzilla-test-cases.patch

Adding new patch with fixes in commit message

0001-CI-test-import-bugzilla-test-cases.patch

While pushing, I've added one more line after a restart operation.

assert not topo.standalone.detectDisorderlyShutdown()

commit ab2ea3743bd9aa9fa623e1a9f3503f2937addae6
Author: Sankar Ramalingam sramling@redhat.com
Date: Thu Aug 3 13:05:56 2017 +0530

Metadata Update from @sramling:
- Custom field reviewstatus adjusted to None (was: review)

Metadata Update from @mreynolds:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2396

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

Metadata