I’m working on a Python application running in Docker. I’m looking for the best way to get test output back from AWS ECS Fargate.
Pytests running using a CircleCI docker image (
cimg/python:3.9) work well and produce output in the CircleCI dashboard.
Deploying the application to ECS Fargate using the CircleCI Orb (
circleci/aws-ecs) works, and the application runs correctly.
However, when we run integration and end-to-end tests from ECS, we cannot get the test output into CircleCI. Our current solution uploads the test output to S3, but this is kludgey and with no way to view the test results in CircleCI.
Is there a better way to do this without enabling SSH on our containers?
Thanks in advance,
I’m not sure that there is a non-kludgy answer as the CircleCI API does not seem to allow an independent process (such as your ECS Fargate instance) to upload to a workflow.
My current planned way of doing this once I get to point of remote deploying containers involves
- The container uploads the test output and a file that indicates the status of the tests. It then uploads a separate file that can be used to indicate that the test has finished.
- The CircleCI job runs a step that checks for the file that indicates that the test has finished and once found it can cat the test output file and exit based on the file that indicates the status of the tests.
All of this will be thrown together using rclone as this will give me a lot of flexibility over storage locations.
Now if there is a better way please can someone post it.
Thank you for your reply, but I hope there is a more elegant solution.
If there isn’t an existing solution, perhaps CircleCI could accept AWS logs? For example, if you launch an ECS instance via the CircleCI Orb, you could have the option to route container logs back to CircleCI.