Search code examples
pythonazureazure-devopsamazon-cloudwatchmoto

Unit test failed with moto in azure pipeline


I made a wrapper for aws cloudwatch in python with boto3.

And I am doing the unit test with moto, everything go smoothly in my local PC.

After I pushed my code to Azure Repo to trigger the pipeline, I always get the error message.

I want to know how is the compatibility of Azure pipeline to run the 'moto' library.


Solution

  • After testing for few days I found the problem finally. I have to scale my searched day to contain my logs timestamp It means my timestamp of metrics is datetime.today(), and I need to set the Metric Data Queries start date and end date parameter to datetime.today() -(+) timedelta(1) to scale the query date, I don't really know why it work without the scaling in local PC.