The truth is somewhere in the middle. A visual inpsection for rust, pits, thread defects etc is required as part of the requalification process - what divers call a "hydro test" - as in fact the hydro test is only part of the requalification process.
Most hydro test facilties do the visual inspection first to ensure they are not wasting time hydro testing a tank that would be failed due to excessive rust, pits, etc, but they still have an obligation to at least take a quick peak inside at the end of the process to ensure it is dry, reasonably clean and reasonably rust free before they stamp it and certify that it can be returned to service.
In my experience, tanks come into a hydro facility with the valves on, are devalved with the valves marked and/or sorted or racked so that they find their way back to the right tank, then tested and dried then revalved but not filled. This is the same basic process for welding tanks, medical O2 tanks, CO2 tanks and scuba tanks. In some cases, a test facility may replace medical O2 valves as a separate service and/or replace the teflon washers on the valves so that they can be filled immediately after they are returned. (It is note worthy that no special O2 cleaning is involved in the hydro tesing process with medical O2 tanks and they don't seem to be exploding with any regularity. O2 tansk do not pick up muhc in the way of contaminants in service and if devalved and re-valved by the facility, they do not pick up significant contaminants during the test process. The average hydro test facility is not a clean room, but the tap water used during the test is not swimming in grease and oil either.)
The average dive shop then does their own scuba industry VIP rather than DOT VIP and fills the tank. Any tumbling is normally done by the shop before the tank goes to hydro to avoid having the hydro tester reject it due to rust. But that also leaves the possibility of some flash rust in the tank.
Some shops may devalve the tank prior to sending it out for hydro test, but that is by no means universal and is not really required. I'd argue it is also not well advised either as it greatly increases the potential for contamination during transist to, from and at the test site.