Skip to content

Commit

Permalink
Test linux zip in China & US Gov regions (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
srprash authored Sep 1, 2022
1 parent d46ac65 commit 5f061e6
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 6 deletions.
39 changes: 33 additions & 6 deletions .github/workflows/continuous-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ jobs:
- linux_deb
- linux_rpm
- linux_zip
- linux_zip_cn
- linux_zip_us_gov

steps:
- name: Checkout repo
Expand All @@ -185,35 +187,60 @@ jobs:

# workaround for handling input value for auto-triggered workflows
# https://dev.to/mrmike/github-action-handling-input-default-value-5f2g
- name: Set AWS region value
- name: Set AWS region and partition values
id: setRegion
run: |
USER_INPUT=${{ github.event.inputs.region }}
# Use user input region or fall back to "us-west-2"
REGION=${USER_INPUT:-"us-west-2"}
echo "::set-output name=region::$REGION"
if [[ ${{ matrix.testcases }} == "linux_zip_cn" ]]; then
echo "::set-output name=region::cn-north-1"
echo "::set-output name=partition::aws-cn"
elif [[ ${{ matrix.testcases }} == "linux_zip_us_gov" ]]; then
echo "::set-output name=region::us-gov-west-1"
echo "::set-output name=partition::aws-us-gov"
else
USER_INPUT=${{ github.event.inputs.region }}
# Use user input region or fall back to "us-west-2"
REGION=${USER_INPUT:-"us-west-2"}
echo "::set-output name=region::$REGION"
echo "::set-output name=partition::aws"
fi
- name: Configure AWS Credentials
if: ${{ steps.setRegion.outputs.partition == 'aws' }}
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.TESTING_ROLE_ARN }}
aws-region: ${{ steps.setRegion.outputs.region }}

- name: Configure AWS Credentials - China
if: ${{ steps.setRegion.outputs.partition == 'aws-cn' }}
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.TESTING_ROLE_ARN_CN }}
aws-region: cn-north-1

- name: Configure AWS Credentials - US Gov
if: ${{ steps.setRegion.outputs.partition == 'aws-us-gov' }}
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.TESTING_ROLE_ARN_US_GOV }}
aws-region: us-gov-west-1

- name: Generate trace data
id: traceData
run: |
sudo chmod +x ./testing/generate_trace_data.sh
./testing/generate_trace_data.sh
- name: Run terraform and send trace data
id: terraformSendData
run: |
cd testing/terraform
terraform init
terraform validate
terraform apply -auto-approve -var-file=./testcases/${{ matrix.testcases }}.tfvars -var=aws_region=${{ steps.setRegion.outputs.region }}
- name: Validate trace data
if: always()
if: steps.terraformSendData.outcome == 'success'
run: |
echo "trace-id: ${{ env.TRACE_ID }}"
echo "sleeping for 60 seconds"
Expand Down
7 changes: 7 additions & 0 deletions testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Testing X-Ray Daemon

This directory contains the resources and logic for testing the functionality of X-Ray Daemon for various test cases. The testcases leverage Terraform with variable configurations to launch X-Ray Daemon on AWS EC2 instances and send a trace through it.

Current features of this testing suite are:
1. Testing the `.zip`, `.deb`, and `.rpm` binaries for x86_64 architecture of Linux platform.
2. Testing the `.zip` binary for x86_64 architecture of Linux platform in China and US Gov AWS partitions.
5 changes: 5 additions & 0 deletions testing/terraform/testcases/linux_zip_cn.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
testing_ami = "amazonlinux2"
daemon_file_name = "aws-xray-daemon-linux-3.x.zip"
daemon_install_command = "unzip aws-xray-daemon-linux-3.x.zip -d ./xray_daemon"
daemon_start_command = "nohup sudo ./xray_daemon/xray --log-level debug --log-file ./xray_daemon/xray_log &"
daemon_package_local_path = "../../distributions/aws-xray-daemon-linux-3.x.zip"
5 changes: 5 additions & 0 deletions testing/terraform/testcases/linux_zip_us_gov.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
testing_ami = "amazonlinux2"
daemon_file_name = "aws-xray-daemon-linux-3.x.zip"
daemon_install_command = "unzip aws-xray-daemon-linux-3.x.zip -d ./xray_daemon"
daemon_start_command = "nohup sudo ./xray_daemon/xray --log-level debug --log-file ./xray_daemon/xray_log &"
daemon_package_local_path = "../../distributions/aws-xray-daemon-linux-3.x.zip"

0 comments on commit 5f061e6

Please sign in to comment.