コード例 #1
0
def wait_for_webserver_connection():
    """Wait for the webserver to respond to HTTP requests."""
    LOGGER.info("Testing for webserver connectivity.")
    query_handler = GraphQLQueryHandler("http://127.0.0.1:12345/graphql")
    timeout = time.time() + 30
    while time.time() < timeout:
        try:
            query_handler.execute("{nothing}")
            LOGGER.info("Up and running")
            return
        except HTTPError:  # BadRequest means the webserver came up.
            LOGGER.info("Up and running")
            return
        except Exception as exception:  # pylint: disable=broad-except
            LOGGER.error("%r", exception)
        LOGGER.warning(
            "Connection could not be established. Trying again in 1s..")
        time.sleep(1)
    raise TimeoutError("Timeout waiting for the webserver to start.")
コード例 #2
0
 def setUpClass(cls):
     cls.query_handler = GraphQLQueryHandler(
         "http://127.0.0.1:12345/graphql")
     cls.events = [
         eiffel_source_change_created_event(),
         eiffel_source_change_submitted_event(),
         eiffel_composition_defined_event(),
         eiffel_artifact_created_event(),
         eiffel_artifact_published_event(),
         eiffel_confidence_level_modified_event("readyForIntegration"),
         eiffel_confidence_level_modified_event("IntegrationTests"),
         eiffel_confidence_level_modified_event("Daily"),
         eiffel_confidence_level_modified_event("Stability"),
         eiffel_confidence_level_modified_event("Weekly"),
         eiffel_confidence_level_modified_event("FredrikIsNojd")
     ]
     cls.logger = logging.getLogger("TestFollowMyCommit")
コード例 #3
0
 def setUpClass(cls):
     cls.query_handler = GraphQLQueryHandler("http://127.0.0.1:12345/graphql")
     cls.events = [
         eiffel_artifact_reused_event()
     ]
     cls.logger = logging.getLogger("TestArtifactReused")
コード例 #4
0
 def setUpClass(cls):
     cls.query_handler = GraphQLQueryHandler("http://127.0.0.1:12345/graphql")
     cls.events = [eiffel_announcement_published_event()]
     cls.logger = logging.getLogger("TestAnnouncementPublished")
コード例 #5
0
 def setUpClass(cls):
     cls.query_handler = GraphQLQueryHandler(
         "http://127.0.0.1:12345/graphql")
     cls.events = [eiffel_activity_triggered_event()]
     cls.logger = logging.getLogger("TestActivityTriggered")