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

2 duration fields in TestCase class #1923

Open
8 of 12 tasks
atodorov opened this issue Sep 16, 2020 · 3 comments
Open
8 of 12 tasks

2 duration fields in TestCase class #1923

atodorov opened this issue Sep 16, 2020 · 3 comments
Labels
feature request MLH Fellowship https://fellowship.mlh.io/programs/open-source € 25 bounty See bounty-program milestone

Comments

@atodorov
Copy link
Member

atodorov commented Sep 16, 2020

Kiwi TCMS needs additional fields for the TestCase class. This is a prerequisite for time tracking features & telemetry some of which is described at https://kiwitcms.org/blog/kiwi-tcms-team/2019/03/03/legacy-reports-become-telemetry/.

Definition of Done:

  • New field TestCase.setup_duration of type DurationField(db_index=True, null=True, blank=True)
  • New field TestCase.testing_duration of type DurationField(db_index=True, null=True, blank=True)
  • New property TestCase.expected_duration - the sum of the previous 2 fields
  • All 3 fields shown in the testcases/get.html
  • get.html shows the 3 fields in a human readable format - will probably need a custom template filter to print in a format like "6 minutes" - NOTE: https://github.com/sookasa/django-timedelta-field/blob/master/timedelta/helpers.py will help but copying verbatim has many implications and we can leave this until the end.
  • setup_duration & testing_duration are added in testcases/mutable.html and can be editted
  • API methods TestCase.create & TestCase.update allow storing values for these fields - tests are updated to match
  • API method TestCase.filter returns the value of all 3 fields - tests are updated to match
  • All 3 fields are available as filters in the /cases/search/ page - special care should be taken for handling filtering by expected_duration, see https://docs.djangoproject.com/en/3.1/ref/models/expressions/#using-f-with-annotations

Note: when DurationField type is used in forms it doesn't have a nice widget so something like
https://github.com/koss-lebedev/bootstrap-duration-picker will probably work. Could be different if there is something nicer.

  • Test coverage for all of the related changes. This means both positive/negative scenarios where this makes sense or scenarios which traverse different branches of the code where that makes sense.
  • test class/test method names are descriptive and reflect the behavior of the subject under test. A good scheme to follow is Test<ClassUnderTest>.test_[who][what][expected_results]
  • CI pass
  • All code review passed & PR merged

Hints:

This issue is part of Kiwi TCMS open source bounty program. For more information see the link(s) in bounty-program milestone

@atodorov
Copy link
Member Author

Related
9348d74,
a43d5a1,
6f0483a,
083e3cd,

git log & search for estimated - there are a few more

840fa03 - timedelta2seconds

@gasharova
Copy link
Contributor

Hello, I'm one of the MLH fellows and I'd like to start with this issue if possible. Awaiting assignment. Thank you in advance.

@atodorov atodorov added the MLH Fellowship https://fellowship.mlh.io/programs/open-source label Feb 11, 2021
APiligrim added a commit to MLH-Fellowship/Kiwi that referenced this issue Feb 16, 2021
This commit is part of the issue kiwitcms#1924 where Kiwi TCMS needs additional fields for the TestExecution class. This is a prerequisite for time tracking features & telemetry. Here are the changes that this commit is trying to make:

- New field TestExecution.start_date of type DateTimeField(db_index=True, null=True, blank=True)

- Renamed the TestExecution.close_date to TestExecution.stop_date and add db_index=True

- Added a new property TestExecution.actual_duration - the difference between the 2 fields

- Added a new property TestExecution.expected_duration -> self.case.expected_duration; for convenience, see kiwitcms#1923

- API method TestExecution.update() supports the new start_date and close_ date fields
gasharova added a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 1, 2021
- Migration file symbol fixes via black
- Added three fields in testcase view (get.html)
- Added two fields in testcase add & edit view
gasharova added a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 3, 2021
- Displays fields directly from objects into get.html
- Removed todos
- Fixed duplicate line
gasharova added a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 5, 2021
- `setup_duration` and `testing_duration` now defaultly nulled until API calls are implemented
- `expected_duration` default return 0 as property for same reason
gasharova added a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 5, 2021
- Test case for random durations being summed
- Test case for an empty setup_duration field OR empty testing_duration field
- Test case for both setup_duration AND testing_duration fields being empty
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- Migration file symbol fixes via black
- Added three fields in testcase view (get.html)
- Added two fields in testcase add & edit view
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- Displays fields directly from objects into get.html
- Removed todos
- Fixed duplicate line
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- `setup_duration` and `testing_duration` now defaultly nulled until API calls are implemented
- `expected_duration` default return 0 as property for same reason
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- Test case for random durations being summed
- Test case for an empty setup_duration field OR empty testing_duration field
- Test case for both setup_duration AND testing_duration fields being empty
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- Test case for random durations being summed
- Test case for an empty setup_duration field OR empty testing_duration field
- Test case for both setup_duration AND testing_duration fields being empty
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- Test case for random durations being summed
- Test case for an empty setup_duration field OR empty testing_duration field
- Test case for both setup_duration AND testing_duration fields being empty
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
Add fields and the migration

Added three fields in models.py:
- setup_duration
- testing_duration
- expected_duration (property deco)

Added new migration to reflect the 2 new duration fields
- Added migration file 0018_add_testcase_duration_fiels.py
- Reflected fields are setup_duration and testing_duration
- The affected models are Testcase and Historicaltestcase

Fixes lint failures and adds fields to templates kiwitcms#1923

- Migration file symbol fixes via black
- Added three fields in testcase view (get.html)
- Added two fields in testcase add & edit view

Displaying duration fields in testcase.get kiwitcms#1923

- Displays fields directly from objects into get.html
- Removed todos
- Fixed duplicate line

Fixes empty fields bug for merge into master kiwitcms#1923

- `setup_duration` and `testing_duration` now defaultly nulled until API calls are implemented
- `expected_duration` default return 0 as property for same reason

Modified expected_duration property to reflect business logic better kiwitcms#1923
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- Test case for random durations being summed
- Test case for an empty setup_duration field OR empty testing_duration field
- Test case for both setup_duration AND testing_duration fields being empty
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- Test case for random durations being summed
- Test case for an empty setup_duration field OR empty testing_duration field
- Test case for both setup_duration AND testing_duration fields being empty
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- Test case for random durations being summed
- Test case for an empty setup_duration field OR empty testing_duration field
- Test case for both setup_duration AND testing_duration fields being empty
APiligrim pushed a commit to MLH-Fellowship/Kiwi that referenced this issue Mar 24, 2021
- Test case for random durations being summed
- Test case for an empty setup_duration field OR empty testing_duration field
- Test case for both setup_duration AND testing_duration fields being empty
APiligrim added a commit to MLH-Fellowship/Kiwi that referenced this issue Apr 16, 2021
- setup_duration & testing_duration are added in testcases/mutable.html and can be editted
APiligrim added a commit to MLH-Fellowship/Kiwi that referenced this issue Apr 22, 2021
- setup_duration & testing_duration are added in testcases/mutable.html and can be editted
APiligrim added a commit to MLH-Fellowship/Kiwi that referenced this issue Apr 24, 2021
- setup_duration & testing_duration are added in testcases/mutable.html and can be editted
APiligrim added a commit to MLH-Fellowship/Kiwi that referenced this issue Apr 30, 2021
- setup_duration & testing_duration are added in testcases/mutable.html and can be editted
APiligrim added a commit to MLH-Fellowship/Kiwi that referenced this issue May 4, 2021
- setup_duration & testing_duration are added in testcases/mutable.html and can be editted
APiligrim added a commit to MLH-Fellowship/Kiwi that referenced this issue May 4, 2021
- setup_duration & testing_duration are added in testcases/mutable.html and can be editted
APiligrim added a commit to MLH-Fellowship/Kiwi that referenced this issue May 4, 2021
- setup_duration & testing_duration are added in testcases/mutable.html and can be editted
APiligrim added a commit to MLH-Fellowship/Kiwi that referenced this issue May 4, 2021
- setup_duration & testing_duration are added in testcases/mutable.html and can be editted
@atodorov
Copy link
Member Author

atodorov commented Sep 6, 2021

CC @mfonism, please see the remaining sub-tasks here.

mfonism added a commit to mfonism/Kiwi that referenced this issue Sep 15, 2021
mfonism added a commit to mfonism/Kiwi that referenced this issue Sep 16, 2021
The API method `TestCase.filter` is extended to work for queries that
contain lookups on the fields `setup_duration`, `testing_duration` and
`expected_duration`.
It also returns the values of all three fields in its result.

Refs kiwitcms#1923
mfonism added a commit to mfonism/Kiwi that referenced this issue Sep 16, 2021
The API method `TestCase.filter` is extended to work for queries that
contain lookups on the fields `setup_duration`, `testing_duration` and
`expected_duration`.
It also returns the values of all three fields in its result.

Refs kiwitcms#1923
mfonism added a commit to mfonism/Kiwi that referenced this issue Sep 17, 2021
mfonism added a commit to mfonism/Kiwi that referenced this issue Sep 21, 2021
The API method `TestCase.filter` is extended to work for queries that
contain lookups on the fields `setup_duration`, `testing_duration` and
`expected_duration`.
It also returns the values of all three fields in its result.

Refs kiwitcms#1923
mfonism added a commit to mfonism/Kiwi that referenced this issue Sep 21, 2021
mfonism added a commit to mfonism/Kiwi that referenced this issue Oct 11, 2021
mfonism added a commit to mfonism/Kiwi that referenced this issue Oct 11, 2021
atodorov pushed a commit that referenced this issue Oct 11, 2021
New fields: setup_duration, testing_duration, expected_duration - all serialized in seconds.
mfonism added a commit to mfonism/Kiwi that referenced this issue Oct 15, 2021
mfonism added a commit to mfonism/Kiwi that referenced this issue Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request MLH Fellowship https://fellowship.mlh.io/programs/open-source € 25 bounty See bounty-program milestone
Projects
None yet
Development

No branches or pull requests

2 participants