There is no definitive test for piriformis syndrome. Diagnosis of piriformis syndrome is made from your description of symptoms and by physical exam using a variety of movements to see if you have pain in the piriformis muscle. In some cases, a contracted or tender piriformis muscle can be found during a physical exam.
Because symptoms can be similar in other conditions, tests such as MRIs may be needed to rule out other causes of sciatic nerve compression, such as a herniated disc.