Ejemplo n.º 1
0
def doDriverSmokeTest(pc):
    #persistenceConstellations.append([persistenceModule1, lLevel, css, 'memory', 'sqllite', True])
    import Smoketest
    try:
        testReport = Smoketest.smokeTestSet(pc[0], pc[1], pc[2], pc[3], pc[4], pc[5], pc[6], pc[7])
        return testReport
    except Exception as e:
        print(("Failure in run %s" %pc[5]))
        testReport = Smoketest.smokeTestSet(pc[0], pc[1], pc[2], pc[3], pc[4], pc[5], pc[6], pc[7])
        raise e
Ejemplo n.º 2
0
def doDriverSmokeTest(pc):
    #persistenceConstellations.append([persistenceModule1, lLevel, css, 'memory', 'sqllite', True])
    import Smoketest
    try:
        testReport = Smoketest.smokeTestSet(pc[0], pc[1], pc[2], pc[3], pc[4],
                                            pc[5], pc[6], pc[7])
        return testReport
    except Exception as e:
        print(("Failure in run %s" % pc[5]))
        testReport = Smoketest.smokeTestSet(pc[0], pc[1], pc[2], pc[3], pc[4],
                                            pc[5], pc[6], pc[7])
        raise e
Ejemplo n.º 3
0
def smokeTestSet(restltQueue, lLevel, css, dbConnectionString = None, persistenceType = None, scaleFactor = 100, createTestDatabase = False):
    '''
    repoLocations = a list of all of the filesystem location that that compose the repository.
    useDeaultSchema.  I True, then load the 'default schema' of Graphyne
    persistenceType = The type of database used by the persistence engine.  This is used to determine which flavor of SQL syntax to use.
        Enumeration of Possible values:
        Default to None, which is no persistence
        "sqlite" - Sqlite3
        "mssql" - Miscrosoft SQL Server
        "hana" - SAP Hana
    persistenceArg = the Module/class supplied to host the entityRepository and LinkRepository.  If default, then use the Graphyne.DatabaseDrivers.NonPersistent module.
        Enumeration of possible values:
        None - May only be used in conjunction with "sqlite" as persistenceType and will throw an InconsistentPersistenceArchitecture otherwise
        "none" - no persistence.  May only be used in conjunction with "sqlite" as persistenceType and will throw an InconsistentPersistenceArchitecture otherwise
        "memory" - Use SQLite in in-memory mode (connection = ":memory:")
        "<valid filename with .sqlite as extension>" - Use SQLite, with that file as the database
        "<filename with .sqlite as extension, but no file>" - Use SQLite and create that file to use as the DB file
        "<anything else>" - Presume that it is a pyodbc connection string and throw a InconsistentPersistenceArchitecture exception if the dbtype is "sqlite".
    createTestDatabase = a flag for creating regression test data.  This flag is only to be used for regression testing the graph and even then, only if the test 
        database does not already exist.
        
        *If persistenceType is None (no persistence, then this is ignored and won't throw any InconsistentPersistenceArchitecture exceptions)
    '''
    #import pydevd
    try:
        try:
            if persistenceType is None:
                #pydevd.settrace()
                from Graphyne.DatabaseDrivers import NonPersistent as persistenceModule1
                testReport = Smoketest.smokeTestSet(persistenceModule1, lLevel, css, "No-Persistence", dbConnectionString, persistenceType, True, True, scaleFactor)
            elif ((persistenceType == "sqlite") and (dbConnectionString== "memory")):
                #pydevd.settrace()
                from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModule2
                testReport = Smoketest.smokeTestSet(persistenceModule2, lLevel, css, "sqllite", dbConnectionString, persistenceType, True, True, scaleFactor)
            elif persistenceType == "memory":
                from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModule4
                testReport = Smoketest.smokeTestSet(persistenceModule4, lLevel, css, "sqllite", dbConnectionString, persistenceType, True, True, scaleFactor)
            else:
                #pydevd.settrace()
                from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModul3
                testReport = Smoketest.smokeTestSet(persistenceModul3, lLevel, css, persistenceType, dbConnectionString, persistenceType, True, True, scaleFactor)
            restltQueue.put(testReport)
        except Exception:
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModul32
            testReport = Smoketest.smokeTestSet(persistenceModul32, lLevel, css, persistenceType, dbConnectionString, persistenceType, True, True, scaleFactor)
            restltQueue.put(testReport) 
    except Exception as e:
        errorMsg = "Error in Smoketest: dbConnectionString=%s, persistenceType=%s, scaleFactor=%s, createTestDatabase=%s.  Traceback = %s"  %(dbConnectionString, persistenceType, scaleFactor, createTestDatabase, e)
        print(errorMsg)
        restltQueue.put(None)
Ejemplo n.º 4
0
def smokeTestSet(restltQueue,
                 lLevel,
                 css,
                 dbConnectionString=None,
                 persistenceType=None,
                 scaleFactor=100,
                 createTestDatabase=False):
    '''
    repoLocations = a list of all of the filesystem location that that compose the repository.
    useDeaultSchema.  I True, then load the 'default schema' of Graphyne
    persistenceType = The type of database used by the persistence engine.  This is used to determine which flavor of SQL syntax to use.
        Enumeration of Possible values:
        Default to None, which is no persistence
        "sqlite" - Sqlite3
        "mssql" - Miscrosoft SQL Server
        "hana" - SAP Hana
    persistenceArg = the Module/class supplied to host the entityRepository and LinkRepository.  If default, then use the Graphyne.DatabaseDrivers.NonPersistent module.
        Enumeration of possible values:
        None - May only be used in conjunction with "sqlite" as persistenceType and will throw an InconsistentPersistenceArchitecture otherwise
        "none" - no persistence.  May only be used in conjunction with "sqlite" as persistenceType and will throw an InconsistentPersistenceArchitecture otherwise
        "memory" - Use SQLite in in-memory mode (connection = ":memory:")
        "<valid filename with .sqlite as extension>" - Use SQLite, with that file as the database
        "<filename with .sqlite as extension, but no file>" - Use SQLite and create that file to use as the DB file
        "<anything else>" - Presume that it is a pyodbc connection string and throw a InconsistentPersistenceArchitecture exception if the dbtype is "sqlite".
    createTestDatabase = a flag for creating regression test data.  This flag is only to be used for regression testing the graph and even then, only if the test 
        database does not already exist.
        
        *If persistenceType is None (no persistence, then this is ignored and won't throw any InconsistentPersistenceArchitecture exceptions)
    '''
    #import pydevd
    try:
        try:
            if persistenceType is None:
                #pydevd.settrace()
                from Graphyne.DatabaseDrivers import NonPersistent as persistenceModule1
                testReport = Smoketest.smokeTestSet(persistenceModule1, lLevel,
                                                    css, "No-Persistence",
                                                    dbConnectionString,
                                                    persistenceType, True,
                                                    True, scaleFactor)
            elif ((persistenceType == "sqlite")
                  and (dbConnectionString == "memory")):
                #pydevd.settrace()
                from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModule2
                testReport = Smoketest.smokeTestSet(persistenceModule2, lLevel,
                                                    css, "sqllite",
                                                    dbConnectionString,
                                                    persistenceType, True,
                                                    True, scaleFactor)
            elif persistenceType == "memory":
                from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModule4
                testReport = Smoketest.smokeTestSet(persistenceModule4, lLevel,
                                                    css, "sqllite",
                                                    dbConnectionString,
                                                    persistenceType, True,
                                                    True, scaleFactor)
            else:
                #pydevd.settrace()
                from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModul3
                testReport = Smoketest.smokeTestSet(persistenceModul3, lLevel,
                                                    css, persistenceType,
                                                    dbConnectionString,
                                                    persistenceType, True,
                                                    True, scaleFactor)
            restltQueue.put(testReport)
        except Exception:
            from Graphyne.DatabaseDrivers import RelationalDatabase as persistenceModul32
            testReport = Smoketest.smokeTestSet(persistenceModul32, lLevel,
                                                css, persistenceType,
                                                dbConnectionString,
                                                persistenceType, True, True,
                                                scaleFactor)
            restltQueue.put(testReport)
    except Exception as e:
        errorMsg = "Error in Smoketest: dbConnectionString=%s, persistenceType=%s, scaleFactor=%s, createTestDatabase=%s.  Traceback = %s" % (
            dbConnectionString, persistenceType, scaleFactor,
            createTestDatabase, e)
        print(errorMsg)
        restltQueue.put(None)