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

Subject: 2 timestamp fields in TestExecution class #1924 #2251

Merged
merged 1 commit into from
Feb 25, 2021

Conversation

APiligrim
Copy link
Contributor

This commit is part of the issue #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 2 duration fields in TestCase class #1923

  • API method TestExecution.update() supports the new start_date and close_ date fields

@atodorov atodorov added the MLH Fellowship https://fellowship.mlh.io/programs/open-source label Feb 16, 2021
Copy link
Member

@atodorov atodorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@APiligrim
Copy link
Contributor Author

Im having some trouble😅 for some reason although I pulled from master, then ran manage.py makemigrations, made another commit and squashed it with all the previous ones I made, calling it "Add: New timestamp fields in TestExecution class .Refs #1924", its still trying to commit them twice. Also the commit with "Merge branch 'anastasiya-branch' of https://github.com/MLH-Fellowship… …" is not showing up when I search for it with rebase log. Do you have any advice on how I can delete the repeated commits that are showing up here? Thank you for all your help!

@atodorov
Copy link
Member

Im having some troublesweat_smile for some reason although I pulled from master, then ran manage.py makemigrations, made another commit and squashed it with all the previous ones I made, calling it "Add: New timestamp fields in TestExecution class .Refs #1924", its still trying to commit them twice. Also the commit with "Merge branch 'anastasiya-branch' of https://github.com/MLH-Fellowship… …" is not showing up when I search for it with rebase log. Do you have any advice on how I can delete the repeated commits that are showing up here? Thank you for all your help!

The commit you see with "Merge branch ..." is called a merge commit, aka 3 way merge (https://hamwaves.com/collaboration/doc/rypress.com/branches-2.html search for 3-way merge).

This happened automatically when you did git pull b/c that means download the new commits and automatically merge them into the current branch. The workflow is usually a bit different:

git checkout master
git fetch upstream  <--- assumes you have another remote configured 
git merge upstream/master  <---- keeps the local master branch clean, performs a fast-forward merge without merge commits
git checkout <your_topic_branch>
git rebase -i master  <--- rebases onto the refreshed local master

Another option if the local master branch is not clean is to rebase against upstream/master after a fetch! (There are others as well).

Don't sweat it too much. The upstream branch is moving very rapidly but unless you need to rebase because of conflicts you can keep working against an older version as well.

tcms/testruns/models.py Outdated Show resolved Hide resolved
tcms/testruns/models.py Show resolved Hide resolved
tcms/testruns/models.py Outdated Show resolved Hide resolved
tcms/testruns/static/testruns/js/get.js Outdated Show resolved Hide resolved
tcms/rpc/api/testexecution.py Outdated Show resolved Hide resolved
tcms/rpc/api/testexecution.py Show resolved Hide resolved
tcms/testruns/models.py Show resolved Hide resolved
@APiligrim
Copy link
Contributor Author

Hi @atodorov! I renamed all the associated "close_date" vars to "stop_date" and I also removed the "case.expected_duration " which refers to #2253 and is b/c at the moment. I see more checks are passing but some are still failing so I'll explore some of those issues 👀

Copy link
Member

@atodorov atodorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the last commit and focus on the other comments from the code review.

Renaming close_date to stop_date should be done where needed, not everywhere where this variable name occurs. As-is the last commit is creating more issues than it solves.

tcms/rpc/api/testexecution.py Outdated Show resolved Hide resolved
tcms/rpc/api/testexecution.py Outdated Show resolved Hide resolved
tcms/testruns/migrations/0004_squashed.py Outdated Show resolved Hide resolved
tcms/testruns/migrations/0012_test_execusion_add_fields.py Outdated Show resolved Hide resolved
tcms/testruns/migrations/0012_test_execusion_add_fields.py Outdated Show resolved Hide resolved
tcms/rpc/tests/test_testexecution.py Outdated Show resolved Hide resolved
tcms/rpc/tests/test_testexecution.py Outdated Show resolved Hide resolved
tcms/testruns/models.py Outdated Show resolved Hide resolved
tcms/testruns/models.py Outdated Show resolved Hide resolved
tcms/testruns/models.py Outdated Show resolved Hide resolved
Copy link
Member

@atodorov atodorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See latest comments & squash all commits together.

Copy link
Member

@atodorov atodorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes requested!

  • Squash commits and update commit log to match!

tcms/testruns/migrations/0012_test_execusion_add_fields.py Outdated Show resolved Hide resolved
Copy link
Member

@atodorov atodorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, docker test failed for unrelated reasons.

As soon as it passes I will merge this PR, check the issue for the next steps.

@atodorov atodorov marked this pull request as ready for review February 25, 2021 20:50
@atodorov atodorov merged commit 22c6ff7 into kiwitcms:master Feb 25, 2021
@atodorov atodorov deleted the anastasiya-branch branch February 25, 2021 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MLH Fellowship https://fellowship.mlh.io/programs/open-source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants