Although neither of these terms necessarily relates to tests, "covert racial discrimination" or "racial discrimination by stealth" would be fairly close to what you seek. If you wish to focus on the tests, you could use "deliberately impossible tests" or "tests designed to be failed". Alternatively, the phrase you used in the question, "tests given in bad faith", was quite clear to me.
A related phenomenon from economics is protectionist regulations imposed within the letter but against the spirit of free trade agreements between countries. For instance I was told that Switzerland demanded that fridges have dimensions slightly different from the standard anywhere else in the world, thus making it next to impossible to import foreign-made fridges but without openly prohibiting it. I feel almost sure that I have seen a term of art describing this practice which could be adapted to apply to covertly discriminatory tests on people, but my searches to find the term have not been successful.
Another possibility is to coin a new term based on the word gerrymandering, since this practice, like gerrymandering, is malicious manipulation of ostensibly fair rules for political advantage.