TrueBlocks / trueblocks-core

The main repository for the TrueBlocks system
https://trueblocks.io
GNU General Public License v3.0
1.05k stars 198 forks source link

Move tests folder to a submodule #3580

Closed tjayrush closed 6 months ago

tjayrush commented 6 months ago

Reasoning:

  1. There are 4,092 files in the ./test/gold folder
  2. Very many of the changes ever pushed to the repo have been in the test folder
  3. No-one runs the tests other than ourselves.
  4. We can do a fair amount of the testing in unit tests
  5. Once the chains start pruning, our tests (which rely on ancient data) will break

Plan of attack below.

tjayrush commented 6 months ago

Plan of attack:

  1. Create a trueblocks-tests repo.
  2. Move all 4,092 files currently in ./test into the root of this repo (including all .gitignore files).
  3. git push trueblocks-tests

In the trueblocks-core repo

  1. git submodule add https://github.com/TrueBlocks/trueblocks-tests tests (note we moved to a new folder called tests)
  2. git commit -am "Adds tests submodule"
  3. Modify all testing code to look to ./tests instead of ./test (should be quite easy)
  4. If tests work looking at ./tests remove ./test
  5. Modify the instructions for cloning the repo (see below).
  6. git push (testing should run and work)

Note that after this the history of the ./test folder will still exist in the repo. We will be removing this later (a re-writing of history)

Modifications to cloning instructions:

git clone ...
git submodule update --init --recursive

Modify the pull instructions to include

git pull --recurse-submodules

To update when test files change:

cd ./tests (into the submodule)
git commit....
git push