Rescue tests #113

Closed
tkdchen opened this Issue Jan 22, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@tkdchen
Member

tkdchen commented Jan 22, 2017

We need to rescue the tests in each app.

  • simplify the fixtures. Create required objects on-demand instead of using a JSON file to provide fixture data.

  • Fix existent tests so that they are able to run. Rewrite some of them if necessary.

  • testplans

  • testcases

  • testruns

  • core

  • xmlrpc

@tkdchen tkdchen added RFE high labels Jan 22, 2017

@tkdchen tkdchen added this to the 4.1 milestone Jan 22, 2017

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Jan 26, 2017

Refactor the way to run tests
Related to #113

With this patch, original way to run tests still works. Now, command
running tests within Makefile is simplified by moving options to
setup.cfg.

I'm planning to rescue the tests and fixtures should be created in
tests' setUp steps, hence customized django-nose test runner class is
dropped and just uses the default one.

Test coverage will always be generated. Environment variable TEST_COVER
is removed from Makefile.

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit that referenced this issue Jan 26, 2017

Refactor the way to run tests
Related to #113

With this patch, original way to run tests still works. Now, command
running tests within Makefile is simplified by moving options to
setup.cfg.

I'm planning to rescue the tests and fixtures should be created in
tests' setUp steps, hence customized django-nose test runner class is
dropped and just uses the default one.

Test coverage will always be generated. Environment variable TEST_COVER
is removed from Makefile.

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>
@tkdchen

This comment has been minimized.

Show comment
Hide comment
@tkdchen

tkdchen Jan 27, 2017

Member

Using a separate package to help creating fixtures, e.g. FactoryBoy, would be much convenient. That was used in a project I contributed before. In my mind, it's easy to create one or more model instances.

/cc @atodorov

Member

tkdchen commented Jan 27, 2017

Using a separate package to help creating fixtures, e.g. FactoryBoy, would be much convenient. That was used in a project I contributed before. In my mind, it's easy to create one or more model instances.

/cc @atodorov

@atodorov

This comment has been minimized.

Show comment
Hide comment
@atodorov

atodorov Jan 27, 2017

Contributor

+1 for using FactoryBoy. I will look at my previous PR that deals with tests.

Contributor

atodorov commented Jan 27, 2017

+1 for using FactoryBoy. I will look at my previous PR that deals with tests.

@tkdchen tkdchen modified the milestones: 4.0, 4.1 Jan 28, 2017

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Jan 28, 2017

Fix testplans tests and all pass
Related to #113

Following two issues are also fixed

* Add missing XML version setting
* Fix error testcase creation when importing from XML document exported
  previously
* Modify `make test' to exclude class name TestCase and TestPlan so that
  both of them are not treated as a "Test case class" by nose.

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Jan 28, 2017

Fix testplans tests and all pass
Related to #113

Following two issues are also fixed

* Add missing XML version setting
* Fix error testcase creation when importing from XML document exported
  previously
* Modify `make test' to exclude class name TestCase and TestPlan so that
  both of them are not treated as a "Test case class" by nose.
@tkdchen

This comment has been minimized.

Show comment
Hide comment
@tkdchen

tkdchen Jan 28, 2017

Member

@atodorov do you have any idea how to use FactoryBoy to organize the fixture creation in Nitrate?

Member

tkdchen commented Jan 28, 2017

@atodorov do you have any idea how to use FactoryBoy to organize the fixture creation in Nitrate?

@atodorov

This comment has been minimized.

Show comment
Hide comment
@atodorov

atodorov Jan 29, 2017

Contributor

Not at the moment. I will have to look at the entire test suite in more details to figure out what needs to be done. However this will not happen in the next 2 weeks probably b/c I will be travelling extensively.

Contributor

atodorov commented Jan 29, 2017

Not at the moment. I will have to look at the entire test suite in more details to figure out what needs to be done. However this will not happen in the next 2 weeks probably b/c I will be travelling extensively.

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 1, 2017

Fix testplans tests and all pass
Related to #113

Following two issues are also fixed

* Add missing XML version setting
* Fix error testcase creation when importing from XML document exported
  previously
* Modify `make test' to exclude class name TestCase and TestPlan so that
  both of them are not treated as a "Test case class" by nose.

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 6, 2017

Fix tests in tcms/core/
Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 6, 2017

Fix tests in tcms/core/
Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

@tkdchen tkdchen self-assigned this Feb 6, 2017

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 18, 2017

Fix xmlrpc tests
Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 18, 2017

Fix xmlrpc tests
Fix #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 18, 2017

Fix xmlrpc tests
Fix #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 20, 2017

Fix xmlrpc tests
Fix #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

@tkdchen tkdchen closed this in #150 Feb 20, 2017

@tkdchen tkdchen reopened this Feb 20, 2017

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 21, 2017

Let testcases tests run again
Test case CaseTests is deleted. At the present time, I have no idea why
that case was written in that way, and those tests are not clear enough
to tell what they test. In addition, the assertions don't make sense.
It is not worth to spend too much time on this case to make them run
again. So, just remove this test case simply, and write new test cases
for models, views (only the necessary part of views it's worth to
test), and other part of testcases app.

Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 21, 2017

Remove legacy test case
This removed test case looks does not test any code of models and
views. It is hard to understand what it tests. Remove it and will write
new test cases to test testruns app.

Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 21, 2017

Let testplans tests run again
Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 21, 2017

Let testplans tests run again
Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 22, 2017

Let testplans tests run again
Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit to tkdchen/Nitrate that referenced this issue Feb 22, 2017

Let testplans tests run again
Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit that referenced this issue Feb 22, 2017

Let testcases tests run again
Test case CaseTests is deleted. At the present time, I have no idea why
that case was written in that way, and those tests are not clear enough
to tell what they test. In addition, the assertions don't make sense.
It is not worth to spend too much time on this case to make them run
again. So, just remove this test case simply, and write new test cases
for models, views (only the necessary part of views it's worth to
test), and other part of testcases app.

Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit that referenced this issue Feb 22, 2017

Remove legacy test case
This removed test case looks does not test any code of models and
views. It is hard to understand what it tests. Remove it and will write
new test cases to test testruns app.

Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

tkdchen added a commit that referenced this issue Feb 22, 2017

Let testplans tests run again
Related to #113

Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>
@tkdchen

This comment has been minimized.

Show comment
Hide comment
@tkdchen

tkdchen Feb 22, 2017

Member

Done

Member

tkdchen commented Feb 22, 2017

Done

@tkdchen tkdchen closed this Feb 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment