Along with testing positive for marijuana, it was ruled that Chris' probation would not be revoked.
Chris was just in court for a probation progress report hearing in his felony battery of Rihanna -- and according to probation report docs ... Brown failed a drug test on June 18 in Virginia, where he was fulfilling his court ordered community service.
According to probation report, Chris told his probation officer he had smoked weed in California -- where he has a medical marijuana prescription -- and then failed the test in Virginia, where weed is illegal ... prescription or no prescription.
Judge Patricia Schnegg said she never ordered Brown to undergo mandatory drug testing as part of his probation, so she cut him a break ... this time ... letting him off with a stern reminder to obey all laws.
Schnegg also ordered Brown's entire case moved back to California because that's where he lives now.
Judge Schnegg also ordered Brown to meet with his probation officer within 72 hours to sort out a discrepancy in community service hours -- prosecutors say he had 121 hours left to complete as of August 15th, but Chris' attorney, Mark Geragos insists he has less than that on his tab.
Earlier today, Rihanna wished Brown a heartfelt good luck in court, to which he expressed his gratitude.