Testing the EPP Plugin

by on May 17, 2013 in Technology
Technology Image

Background

With many Rapid Scripting API customers having multiple test systems there is often a need to test quickly if the associated EPP node is correctly installed and configured. To this end I created a script that can be run from a sample or a file in order to test the underlying plumbing, without the need to apply much configuration to the system.

Script

Since Python is ubiquitous on Unix/Linux systems – and easily installed on other platforms – I opted to create my script in Python. For reference, this script was named EPPSmokeTest.py

import getopt
import sys
import datetime

BASE_DIR = ""

def writeFile( fName, lstLines ):

       global BASE_DIR

       fOut = open( BASE_DIR + fName, "w" )
       fOut.writelines( lstLines )
       fOut.close()

def main():

       outFile = ""

       opts, extraparams = getopt.getopt(sys.argv[1:], "o:")

       for o,p in opts:

           if o in ['-o','--output']:
               outFile = p

      if len(outFile) > 0:
           lines = []
           lines.append( "It worked\n" )
           lines.append( str( datetime.datetime.now() ) )

           writeFile( outFile, lines )

if __name__ == "__main__":
   main()

About the Script

It could probably be written with fewer lines, and you may even describe it as overly complex. However, most of the code I pulled from existing scripts, and so I didn’t spend a great deal of time ‘engineering’ this to be short and elegant.

Use

When configuring a Genologics LIMS Process to utilize this script, the command line syntax defined in the Process configuration dialog box should be in the following format

python EPPSmokeTest.py -o {compoundOutputFileLuid0}.txt

The process should accept both analytes and resultfiles as inputs, and should create a shared resultfile as output.

Notes

  1. This code was written and tested using Python version 2.7, but it should have reasonable backward and forward compatibility
  2. This code was tested against GenoLogics LIMS versions 7.5, but should work with all 7.x systems

Share