The second sentence is grammatically incorrect.
tested; testing; tests
1: to put to test or proof : TRY —often used with out
2: to require a doctrinal oath of
a: to undergo a test
b: to be assigned a standing or evaluation on the basis of tests
tested positive for cocaine
the cake tested done
2: to apply a test as a means of analysis or diagnosis —used with for
test for mechanical aptitude
In the first sentence, it's definition 1b of the intransitive verb that applies. This is because O'Brien is not testing a direction object; the verb test is being used intransitively to say that he has been "assigned an evaluation, on the basis of tests, of being positive for coronavirus"
The second sentence is in the passive voice. In this instance, O'Brien is the direct object of the verb test. However, there are no versions of test as a transitive verb that would then make sense.
If you constructed the sentence yourself, then you can dismiss it as just incorrect. If you, in fact, read it in some reporting, then it's either an error, or it could possibly be a contraction of a valid sentence, such as:
White house national security adviser Robert O'Brien has been tested [and found to be] positive for Covid-1, a senior administration official says.
Some outlets take liberties with English grammar to save column inches.