Is it possible to change code without Git, knowing this?

I did tests this morning, and there are 2 failures. But I did not change any code for several days, and all tests passed.

There are no changes according to Git (with the exception of cover.data, which is a test output). gitk does not show any other changes.

How does Git know when code changes? Could this be caused by SSD crash / error?

What is the best way to find out what happened?

EDIT: working with Ruby on Rails with the Unit Test framework.

+6
source share
3 answers

I would start by finding out the reasons for the failed tests, and this may give you some clues as to how they might have gone before. Sometimes this is a synchronization problem, intermittent failure, something external for the test harness, data change, date or time change, all kinds of things.

+10
source

I see that Mike has found your problem (tick a small square of the answer).

Yes, the code can be changed without Git, knowing this. The file that caused the crash, possibly a temporary test file or device, can be ignored either in .gitignore or in .git / info / exclude format. Running git clean -dxf will clear the check of everything that git doesn't know. git status --ignored display files ignored by git. If this is the case, you want to add a better test flush as part of your test runner.

For posterity, here a short list of testing methods may fail if there is no change to the code visible to git:

  • "Temporary" test files and devices may be dirty.
  • "Temporary" databases and tables may be dirty.
  • It is sensitive to time or date.
  • It uses network resources, and they have changed.
  • Changed the compiler.
  • Installed libraries have been changed.
    • Libraries used by libraries have been changed.
  • The core has been changed.
  • All servers used (databases, web servers, etc.) have been changed.
  • It uses parallel processing, and sometimes a small error occurs.
  • The disk (or file system where the temporary files go) is full.
  • The disk (or file system where temporary files go).
  • The quotas for your memory / disk / process / file have been reduced.
  • The device has run out of memory.
  • The machine has run out of file descriptors.
  • It uses devices with randomly generated data and generates some that tickled the error.
+9
source

Your repository cannot have any changes without Git, knowing this and writing it somewhere, because you need to get the logs so that they can get the repo files. I would like to check that the failures are not caused by something on the machine that should not start at the same time as the tests or it could be a race condition that you do not expect.

+2
source

Source: https://habr.com/ru/post/900445/


All Articles