aws/amazon-cloudwatch-agent uses Github workflows to do various things. One of the things is running integration tests against each new agent code commit to the repository. Personal forks of agent code can do the same thing.
This section is written to help new contributors onboard before they have to dive deep into the code. Note that this document may become outdated, so only use this for initial education purposes.
- MakeBinary:
- Make binaries for all supported OSs, cache them to not repeat this expensive step (~15 minutes) for when github_sha hasn’t changed, sign them all (including the final artifacts for Linux - e.g amazon-cloudwatch-agent.rpm, etc). Then The packages get uploaded to s3 for dependent steps to download and install agent. Docker image of the agent also gets built and added to the aws account’s ECR for dependent steps to use to run agent. Code for this is entirely in the agent repo.
- GenerateTestMatrix
- Github workflow step defined in the agent repo checks out the test repository to use integration test package’s test_case_generator. The test generator creates a map of which test workflow step needs to run which set of test suites where each suite is defined at the go package level. Each suite is therefore expressed as a directory name that contains various tests in the suite. The output of this is stored in the workflow so that later steps can figure out which tests to run.
- SignMacAndWindowsPackage
- MakeBinary steps signs all the binaries; however, it does not sign the final artifact (e.g amazon-cloudwatch-agent.msi, etc) and each final artifact needs to be built in their corresponding OS. Therefore, this step signs the final artifacts and uploads the final sign artifacts to S3.
- MakeBinary, GenerateTestMatrix
- ECSFargateIntegrationTest
- MakeBinary, GenerateTestMatrix, and StartLocalStack.
- Unlike ECS, StartLocalStack is needed because #TODO
- EC2LinuxIntegrationTest
- StopLocalStack because #TODO
- MakeBinary
- MakeMacPkg. Using binary created by MakeBinary, build mac packages and upload to s3. Code for this is entirely in the agent repo.
- SignMacAndWindowsPackage.
- MakeBinary.
- MakeMSIZip. Using windows zip created byMakeBinary, make some required changes for the next BuildMSI step, re-zip, and upload to s3. Code for this is entirely in the agent repo.
- BuildMSI. Using the zip created and uploaded by MakeMSIZip, build an agent installer for windows (MSI). Code for this is entirely in the agent repo.
- SignMacAndWindowsPackage.
- MakeBinary, GenerateTestMatrix and StartLocalStack
- BuildMSI. We run both Linux and Windows Tests
- EC2NvidiaGPUIntegrationTest
- MakeBinary, GenerateTestMatrix and StartLocalStack
- PerformanceTrackingTest