Ejemplo n.º 1
0
            except:
                pass

        atexit.register(_cleanup)

    info("Testing `%(GIT_REVISION)s' in %(TEST_DIR)s" % CONFIG)

    reinitialize_everything = True

    if reinitialize_everything:
        drop_old_data()
        setup_cms()
    else:
        os.chdir("%(TEST_DIR)s" % CONFIG)
        os.environ["PYTHONPATH"] = "%(TEST_DIR)s" % CONFIG
        read_cms_config()

    # Now run the tests from the checkout.
    sh(["./cmstestsuite/RunTests.py"] + args.arguments)

    # We export the contest, import it again and re-run the tests on the
    # existing contest. Hard-coded contest indicies should be correct, as we
    # own the database.
    sh(["./cmscontrib/ContestExporter.py", "-c", "1"])
    sh(["./cmscontrib/ContestImporter.py", "dump_testcontest1.tar.gz"])
    sh(["./cmstestsuite/RunTests.py", "-c", "2"] + args.arguments)

    # Export coverage results.
    sh("python -m coverage xml --include 'cms*'")
    shutil.copyfile("coverage.xml", "%(GIT_ORIGIN)s/coverage.xml" % CONFIG)
Ejemplo n.º 2
0
                shutil.rmtree("%(TEST_DIR)s" % CONFIG)
            except:
                pass
        atexit.register(_cleanup)

    info("Testing `%(GIT_REVISION)s' in %(TEST_DIR)s" % CONFIG)

    reinitialize_everything = True

    if reinitialize_everything:
        drop_old_data()
        setup_cms()
    else:
        os.chdir("%(TEST_DIR)s" % CONFIG)
        os.environ["PYTHONPATH"] = "%(TEST_DIR)s" % CONFIG
        read_cms_config()

    # Now run the tests from the checkout.
    sh(["./cmstestsuite/RunTests.py"] + args.arguments)

    # We export the contest, import it again and re-run the tests on the
    # existing contest. Hard-coded contest indicies should be correct, as we
    # own the database.
    sh(["./cmscontrib/ContestExporter.py", "-c", "1"])
    sh(["./cmscontrib/ContestImporter.py", "dump_testcontest1.tar.gz"])
    sh(["./cmstestsuite/RunTests.py", "-c", "2"] + args.arguments)

    # Export coverage results.
    sh("python -m coverage xml --include 'cms*'")
    shutil.copyfile("coverage.xml", "%(GIT_ORIGIN)s/coverage.xml" % CONFIG)