-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,841 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Integration Tests | Logging | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
logging-integration-test-iOS: | ||
runs-on: macos-12 | ||
environment: IntegrationTest | ||
steps: | ||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Make directory | ||
run: mkdir -p ~/.aws-amplify/amplify-ios/testconfiguration/ | ||
|
||
- name: Copy integration test resouces | ||
uses: ./.github/composite_actions/download_test_configuration | ||
with: | ||
resource_subfolder: logging | ||
aws_role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
aws_region: ${{ secrets.AWS_REGION }} | ||
aws_s3_bucket: ${{ secrets.AWS_S3_BUCKET_INTEG_V2 }} | ||
|
||
- name: Run Integration test | ||
uses: ./.github/composite_actions/run_xcodebuild_test | ||
with: | ||
project_path: ./AmplifyPlugins/Logging/Tests/AWSCloudWatchLoggingPluginHostApp | ||
scheme: AWSCloudWatchLoggingPluginIntegrationTests | ||
|
||
logging-integration-test-tvOS: | ||
runs-on: macos-13 | ||
environment: IntegrationTest | ||
steps: | ||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Make directory | ||
run: mkdir -p ~/.aws-amplify/amplify-ios/testconfiguration/ | ||
|
||
- name: Copy integration test resouces | ||
uses: ./.github/composite_actions/download_test_configuration | ||
with: | ||
resource_subfolder: logging | ||
aws_role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
aws_region: ${{ secrets.AWS_REGION }} | ||
aws_s3_bucket: ${{ secrets.AWS_S3_BUCKET_INTEG_V2 }} | ||
|
||
- name: Run Integration test | ||
uses: ./.github/composite_actions/run_xcodebuild_test | ||
with: | ||
project_path: ./AmplifyPlugins/Logging/Tests/AWSCloudWatchLoggingPluginHostApp | ||
scheme: AWSCloudWatchLoggingPluginIntegrationTests | ||
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest | ||
sdk: appletvsimulator | ||
xcode_path: '/Applications/Xcode_14.3.app' | ||
|
||
logging-integration-test-watchOS: | ||
runs-on: macos-13 | ||
environment: IntegrationTest | ||
steps: | ||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Make directory | ||
run: mkdir -p ~/.aws-amplify/amplify-ios/testconfiguration/ | ||
|
||
- name: Copy integration test resouces | ||
uses: ./.github/composite_actions/download_test_configuration | ||
with: | ||
resource_subfolder: logging | ||
aws_role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
aws_region: ${{ secrets.AWS_REGION }} | ||
aws_s3_bucket: ${{ secrets.AWS_S3_BUCKET_INTEG_V2 }} | ||
|
||
- name: Run Integration test | ||
uses: ./.github/composite_actions/run_xcodebuild_test | ||
with: | ||
project_path: ./AmplifyPlugins/Logging/Tests/AWSCloudWatchLoggingPluginHostApp | ||
scheme: AWSCloudWatchLoggingPluginIntegrationTestsWatch | ||
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=latest | ||
sdk: watchsimulator | ||
xcode_path: '/Applications/Xcode_14.3.app' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...gPluginHostApp/AWSCloudWatchLoggingPluginIntegrationTests/AWSCloudWatchClientHelper.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
import AWSCloudWatchLogs | ||
|
||
class AWSCloudWatchClientHelper { | ||
static func getFilterLogEventCount(client: CloudWatchLogsClientProtocol?, filterPattern: String?, startTime: Date?, endTime: Date?, logGroupName: String?) async throws -> [CloudWatchLogsClientTypes.FilteredLogEvent]? { | ||
let filterEventInput = FilterLogEventsInput(endTime: endTime?.epochMilliseconds, filterPattern: filterPattern, logGroupName: logGroupName, startTime: startTime?.epochMilliseconds) | ||
let response = try await client?.filterLogEvents(input: filterEventInput) | ||
return response?.events | ||
} | ||
} | ||
|
||
extension Date { | ||
var epochMilliseconds: Int { | ||
Int(self.timeIntervalSince1970 * 1_000) | ||
} | ||
} |
Oops, something went wrong.