Each time I compress a file via the command line 7zip is nice enough to return "Everything is okay". I know that I can test the integrity of an archive if I run the command
7z t archive.zip but is it necessary if the former is being displayed? What added advantage is there?
"Necessary" is a somewhat relative term. When 7-Zip says that everything is okay, this just means that it didn't detect any errors during its compression process, and that it thinks it wrote out the compressed file successfully.
It's conceivable that 7-Zip could have a bug that would cause it to fail to detect an error in compression. This is probably fairly unlikely, since 7-Zip is widely used and therefore pretty well-tested in practice. A more likely scenario is a hardware problem that causes 7-Zip not to produce or write out a correct output. This could be due to a problem with your hard disk, your RAM, overheating of hardware, or any number of other things. 7-Zip is not likely to detect such an error. So doing a test of the archive afterwards is a decent way to detect such problems, but not totally guaranteed either. (I'd say it's not at all unlikely that you might run into bad hardware at some point in your lifetime.)
So, the bottom line is, I'd say that if the data's important to you, then go ahead and test the archive afterwards.