nus-cs2103-AY2425S1 / forum

12 stars 0 forks source link

Test case failing across many different test files #494

Open jowhee3011 opened 2 hours ago

jowhee3011 commented 2 hours ago

Hello, I've made some minor changes to the add command feature, however, it has been causing me gradle build errors as I am failing the given test cases, even those that aren't related to add command.

Most of the errors prompt me the following. image

Is there any way I can go about this? I am rather sure my code changes do not affect the test cases.

PR: https://github.com/AY2425S1-CS2103T-T11-3/tp/pull/42

damithc commented 2 hours ago

@jowhee3011 A general approach to locate the cause of a problem is to go back to the last known 'correct' state, and incrementally add the changes while running tests after each change. If you add only a few lines at a time, you'll be able to locate which few lines cause the tests to start failing. For example,

  1. Go back to master branch. Start a new branch. Run tests to ensure they pass.
  2. Repeat a small part of the changes in this branch. Run tests. If they pass, commit those changes.
  3. Keep doing the above step until tests start to fail. When they do, the uncommitted changes are the lines you need to look into.

If using that approach, you need to be running tests locally, not relying on the PR CI runs (the latter will take too long).