Project

General

Profile

Please look at issue 38278 Basename of repository and Branch/Tags in Changeset Description

Added by Niklaus Giger about 1 year ago

Hi

I opened https://www.redmine.org/issues/38278 with a patch which is in use in our organisation for several years.
It is enhanced version of https://www.redmine.org/issues/5386, which has also patches available since many years.
What can I do get a feedback to these issues?
Eg. I know my patch has no test case included, but never found a test case which I could improve/base on.

Best regards

Niklaus


Replies (2)

RE: Please look at issue 38278 Basename of repository and Branch/Tags in Changeset Description - Added by Julia Ann 10 months ago

Niklaus Giger wrote:

Hi

I opened https://www.redmine.org/issues/38278 with a patch which is in use in our organisation for several years.
It is enhanced version of https://www.redmine.org/issues/5386, which has also patches available since many years.
What can I do get a feedback to these issues?
Eg. I know my patch has no test case included, but never found a test case which I could improve/base on.

Best regards

Niklaus

Here are some general steps you can follow to proceed with testing the changes:

Understand the changes: Review the changes made in the patch and understand their purpose and expected behavior. Ensure that you have a clear understanding of what the patch is trying to accomplish and how it affects the display of revisions.

Identify the affected code: Determine which parts of the codebase are modified by the patch. Focus on the relevant files and functions that are related to the display of revisions, repository information, and associated links.

Write test cases: Based on the changes made by the patch, write test cases that cover the modified functionality. Consider various scenarios and edge cases to ensure comprehensive testing. Test cases can include verifying the display of the repository basename, checking the presence and correctness of associated revision and diff links, and validating the behavior under different circumstances.

Setup test environment: Ensure that you have a proper test environment set up for Redmine. This typically involves creating a separate test database and configuring the necessary testing infrastructure.

Implement test cases: Write the necessary test cases based on your understanding of the changes and the affected code. Use Redmine's testing framework and APIs to simulate the expected behavior and assertions.

Run the tests: Execute the tests using the appropriate command, such as RAILS_ENV=test bundle exec rake test:scm:functionals. Monitor the test output for any failures or errors.

Debug and fix issues: If the tests fail or encounter errors, analyze the failure messages and stack traces to identify the root cause. Debug the code and modify the test cases or patch as needed to resolve any issues.

Iterate and refine: Continue iterating on the tests and patch as necessary to improve the test coverage and ensure the changes are properly validated.

RE: Please look at issue 38278 Basename of repository and Branch/Tags in Changeset Description - Added by Niklaus Giger 10 months ago

Hi Julia,

Thanks for looking at my issue!

As I am already 67 years old and have over 20 years experience with ruby and CI, I think I really tried to follow the steps you outlined, because it fits my working habits.
However the line I patched, is not covered (as far as I could see) by any test case.

E.g: I addede (using ruby 3.1.4 and a sqlite database) a debugger statement at the first line app/views/issues/tabs/_changesets.html.erb.
But running RAILS_ENV=test bundle exec rake test only enters it once and the associated changeset does not contain any filechanges.

(ruby) @changesets
[#<Changeset:0x00007fd6ee692540
  id: 102,
  repository_id: 10,
  revision: "3",
  committer: "dlopper",
  committed_on: Thu, 12 Apr 2007 13:14:44.000000000 UTC +00:00,
  comments: "A commit with wrong issue ids\nIssueID #666 #3",
  commit_date: Thu, 12 Apr 2007,
  scmid: nil,
  user_id: 3>]
(rdbg)

And creating such a changeset needs more time than I can afford. Grand-children have priority (sorry).

    (1-2/2)