|
3 | 3 | name: Plugin Patch Test
|
4 | 4 |
|
5 | 5 | jobs:
|
6 |
| - test_plugin_patch: |
| 6 | + test_plugin_ec2: |
7 | 7 | runs-on: ubuntu-latest
|
8 | 8 |
|
9 | 9 | steps:
|
@@ -64,26 +64,99 @@ jobs:
|
64 | 64 | fi
|
65 | 65 |
|
66 | 66 | - name: Run EC2 - Create Instance Tests
|
| 67 | + run: | |
| 68 | + source .venv/bin/activate |
| 69 | +
|
| 70 | + export LOCALSTACK_API_KEY=${{ secrets.LOCALSTACK_API_KEY }} |
| 71 | + options="-s -v --ls-start --gather-metrics" |
| 72 | +
|
| 73 | + ec2_test="terraform-provider-aws/internal/service/ec2/ec2_host_data_source_test.go::TestAccEC2HostDataSource_basic terraform-provider-aws/internal/service/ec2/ec2_host_data_source_test.go::TestAccEC2HostDataSource_filter terraform-provider-aws/internal/service/ec2/ec2_host_test.go::TestAccEC2Host_basic terraform-provider-aws/internal/service/ec2/ec2_host_test.go::TestAccEC2Host_disappears terraform-provider-aws/internal/service/ec2/ec2_host_test.go::TestAccEC2Host_instanceFamily terraform-provider-aws/internal/service/ec2/ec2_host_test.go::TestAccEC2Host_tags terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_basic terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_tags terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_azUserData terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_RootBlockDevice_kmsKeyID terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_rootInstanceStore terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_privateIP terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_keyPair terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_vpc terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_placementGroup terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_securityGroups terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_vpcSecurityGroups terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_getUserData terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_GetUserData_noUserData terraform-provider-aws/internal/service/ec2/ec2_instance_data_source_test.go::TestAccEC2InstanceDataSource_timeout" |
| 74 | + python -m pytest --junitxml=target/reports/pytest.xml $(python terraform_pytest/get_tf_partitions.py $ec2_test $options |
| 75 | +
|
| 76 | + - name: Archive Test Result |
| 77 | + uses: actions/upload-artifact@v3 |
| 78 | + if: always() |
| 79 | + with: |
| 80 | + name: test-metrics |
| 81 | + path: target/reports |
| 82 | + |
| 83 | + - name: Publish ${{ matrix.service }} Test Results |
| 84 | + uses: EnricoMi/publish-unit-test-result-action@v2 |
| 85 | + if: always() |
| 86 | + with: |
| 87 | + junit_files: target/reports/*.xml |
| 88 | + check_name: ${{ matrix.service }} Terraform Test Results |
| 89 | + |
| 90 | + test_plugin_rds: |
| 91 | + runs-on: ubuntu-latest |
| 92 | + |
| 93 | + steps: |
| 94 | + |
| 95 | + - uses: actions/checkout@v3 |
| 96 | + with: |
| 97 | + submodules: 'true' |
| 98 | + |
| 99 | + - uses: actions/setup-go@v3 |
| 100 | + with: |
| 101 | + go-version: '1.20.x' |
| 102 | + cache: true |
| 103 | + cache-dependency-path: terraform-provider-aws/go.sum |
| 104 | + |
| 105 | + - name: Set up Python 3.10.5 |
| 106 | + uses: actions/setup-python@v4 |
| 107 | + with: |
| 108 | + python-version: '3.10.5' |
| 109 | + cache: 'pip' |
| 110 | + |
| 111 | + - name: Install system dependencies |
| 112 | + run: | |
| 113 | + python -m venv .venv |
| 114 | + source .venv/bin/activate |
| 115 | + pip install --upgrade pip |
| 116 | + pip install -r requirements.txt |
| 117 | +
|
| 118 | + - name: Patch Terraform Provider |
| 119 | + run: | |
| 120 | + source .venv/bin/activate |
| 121 | + cd terraform-provider-aws && go mod vendor |
| 122 | + cd ../ |
| 123 | + python -m terraform_pytest.main patch |
| 124 | +
|
| 125 | + - name: Build RDS Binary |
| 126 | + run: | |
| 127 | + source .venv/bin/activate |
| 128 | + python -m terraform_pytest.main build -s rds |
| 129 | + ls -la ./test-bin |
| 130 | +
|
| 131 | + - name: Setup LocalStack |
67 | 132 | env:
|
68 |
| - SERVICE: ec2 |
69 |
| - PARTITION: null |
70 |
| - TINYBIRD_URL: https://api.tinybird.co |
71 |
| - TINYBIRD_DATASOURCE: localstack_terraform_test_results |
72 |
| - TINYBIRD_TOKEN: ${{ secrets.TINYBIRD_TOKEN }} |
73 |
| - CI_COMMIT_SHA: ${{ github.sha }} |
74 |
| - CI_JOB_ID: ${{ github.job }} |
75 |
| - CI_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
76 |
| - CI_JOB_NAME: ${{ github.job }}-${{ matrix.service_partition.service }}-${{ matrix.service_partition.partition }} |
| 133 | + LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} |
| 134 | + TMP_USER: ${{ secrets.TMP_USER }} |
| 135 | + TMP_PW: ${{ secrets.TMP_PW }} |
77 | 136 | run: |
|
78 | 137 | source .venv/bin/activate
|
| 138 | + pip install --pre localstack |
79 | 139 | enable_pro=${{ inputs.enable-pro || 'true' }}
|
80 |
| - enable_tinybird='false' |
81 |
| - if [[ $enable_pro == 'true' ]] |
| 140 | + if [[ $enable_pro != 'true' ]] |
82 | 141 | then
|
83 |
| - export LOCALSTACK_API_KEY=${{ secrets.LOCALSTACK_API_KEY }} |
| 142 | + docker pull localstack/localstack |
| 143 | + else |
| 144 | + docker pull localstack/localstack-pro |
| 145 | + localstack auth login -u $TMP_USER -p $TMP_PW # login is currently required |
| 146 | + localstack extensions init |
| 147 | + localstack extensions install "git+https://github.com/localstack/localstack-moto-test-coverage/#egg=collect-raw-metric-data-extension&subdirectory=collect-raw-metric-data-extension" |
84 | 148 | fi
|
85 |
| - |
86 |
| - python -m pytest --junitxml=target/reports/pytest.xml terraform-provider-aws/internal/service/ec2/ec2_instance_test.go::TestAccEC2Instance_basic -s -v --ls-start --gather-metrics |
| 149 | +
|
| 150 | + - name: Run RDS - Create Instance Tests |
| 151 | + run: | |
| 152 | + source .venv/bin/activate |
| 153 | +
|
| 154 | + export LOCALSTACK_API_KEY=${{ secrets.LOCALSTACK_API_KEY }} |
| 155 | + options="-s -v --ls-start --gather-metrics" |
| 156 | +
|
| 157 | + rds_test="terraform-provider-aws/internal/service/rds/cluster_data_source_test.go::TestAccRDSClusterDataSource_basic terraform-provider-aws/internal/service/rds/cluster_instance_test.go::TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1 terraform-provider-aws/internal/service/rds/cluster_instance_test.go::TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraPostgresql terraform-provider-aws/internal/service/rds/cluster_instance_test.go::TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL1 terraform-provider-aws/internal/service/rds/cluster_instance_test.go::TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKeyToCustomKey terraform-provider-aws/internal/service/rds/cluster_instance_test.go::TestAccRDSClusterInstance_performanceInsightsRetentionPeriod terraform-provider-aws/internal/service/rds/cluster_instance_test.go::TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraPostgresql terraform-provider-aws/internal/service/rds/cluster_instance_test.go::TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraPostgresql_defaultKeyToCustomKey terraform-provider-aws/internal/service/rds/cluster_test.go::TestAccRDSCluster_disappears terraform-provider-aws/internal/service/rds/cluster_test.go::TestAccRDSCluster_tags terraform-provider-aws/internal/service/rds/cluster_test.go::TestAccRDSCluster_identifierGenerated terraform-provider-aws/internal/service/rds/cluster_test.go::TestAccRDSCluster_identifierPrefix" |
| 158 | +
|
| 159 | + python -m pytest --junitxml=target/reports/pytest.xml $rds_test $options |
87 | 160 |
|
88 | 161 | - name: Archive Test Result
|
89 | 162 | uses: actions/upload-artifact@v3
|
|
0 commit comments