I am really frustrated by this whole situation, and here is why:
I inherited a completely untested legacy system for keeping many different client databases and one master database (with a different schema) in sync. The system was only partially finished when it was given to me, with many defects preventing it from working correctly ~90% of the time.
This system also has six different types of synchronizations allowed, each synchronizing different (sometimes overlapping) tables, since the databases can be fairly large, so the clients can prioritize the most important tables first depending on their state.
I started with a few end-to-end tests, setting up a master and several client databases locally with certain data then calling the different synchronization methods and verifying the right data showed up in the right databases in the right format.
I was pressed for time, and since this system has at least a hundred different ways that data can move from one database to another and is only a few thousand lines of code, I just kept making more and more end-to-end tests, basically 1-2 per defect that existed when I took over the project. I finished the system with 16 unit tests (TDD'd from the code I added) and 113 end-to-end tests, many of which were directly based off prior defects.
I finished the system, and it has been in production for several months without incident.
Recently, we decided to convert the client database to a new database, and when I ran my tests (which have been running nightly in a CI server this whole time) with the new database, about 100 of 113 failed. (The unit tests all pass, of course).
I have been fixing the failing end-to-end tests, and frankly, most failed for one or two simple reasons, (like the new database rounding dates differently) but I am frustrated by the fact that my tests were so brittle. While they correctly failed, I only needed one or two to tell me that, not 100. The problem is, there is not that much code to unit test, because most of it is just selecting data out of one table based on dates, then selecting the same data out of another database, merging the two, then inserting/updating appropriately.
There is no way I could have completed this system without these tests, but the pain of maintaining them is basically what leads me to this question: any suggestions how I should proceed/or what I could have done better? Did I waste too much time writing these end-to-end tests the first time? I read Working Effectively with Legacy Code, but I felt like there was not really a good answer in there for the sort of pain I was feeling, other than: "just refactor and write more unit tests" which I feel is not really much of an option do to the unique nature of this system being very little code and a lot of database conversion.