Is there a better way to write integration tests? ...
# ask-for-help
f
Is there a better way to write integration tests? The docs suggest to use the following to start the server:
Copy code
subprocess.Popen(
            [
                "bentoml",
                "serve",
                "embedding.service:EmbeddingService",
                "-p",
                str(cls.port),
            ],
            env=env,
        )
It works to run the integration tests, but I can't debug inside the service's code and I'm afraid it will also impact test coverage metrics. I'm currently replacing a service that was implemented with Tornado with BentoML and they run the service as follows:
Copy code
sock, port = bind_unused_port()
        self.http_client = AsyncHTTPClient()
        self.__port = port
        self._test_env = ENV_TEST
        self._app = make_app(self._test_env)
        self.http_server = HTTPServer(self._app)
        self.http_server.add_sockets([sock])
This way, the service runs from the same process. Is it possible to do something similar in BentoML?