Skip to content

Commit

Permalink
Revert temporarily commented logic in PrepareRelease. Fix client name…
Browse files Browse the repository at this point in the history
… bug. Add convenience script for running every smoke test.
  • Loading branch information
Sichan Yoo committed Oct 16, 2024
1 parent cc056bc commit 19914a1
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ struct PrepareRelease {
try FileManager.default.changeWorkingDirectory(repoPath)

let previousVersion = try getPreviousVersion()
// guard try repoHasChanges(previousVersion) else {
// /// If repo has no changes, create an empty release-manifest.json file.
// /// Empty manifest file makes GitHubReleasePublisher be no-op.
// /// The manifest file is required regardless of whether there should
// /// be a release or not.
// try createEmptyReleaseManifest()
// /// Return without creating new commit or tag in local repos.
// /// This makes GitPublisher be no-op.
// return
// }
guard try repoHasChanges(previousVersion) else {
/// If repo has no changes, create an empty release-manifest.json file.
/// Empty manifest file makes GitHubReleasePublisher be no-op.
/// The manifest file is required regardless of whether there should
/// be a release or not.
try createEmptyReleaseManifest()
/// Return without creating new commit or tag in local repos.
/// This makes GitPublisher be no-op.
return
}
let newVersion = try createNewVersion(previousVersion)

try stageFiles()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class AWSSmokeTestGenerator(
// Filter out tests by name or tag at codegen time.
// Each element must have the prefix "<service-name>:" before the test name or tag name.
// E.g., "AWSS3:GetObjectTest" or "AWSS3:BucketTests"
override val testIdsToIgnore = setOf<String>(
override val smokeTestIdsToIgnore = setOf<String>(
// Add smoke test name to ignore here:
// E.g., "AWSACM:GetCertificateFailure",
)
override val testTagsToIgnore = setOf<String>(
override val smokeTestTagsToIgnore = setOf<String>(
// Add smoke test tag to ignore here:
// E.g., "AWSACM:TagToIgnore",
)
Expand All @@ -27,7 +27,7 @@ class AWSSmokeTestGenerator(
}

override fun getClientName(): String {
return ctx.service.getTrait(ServiceTrait::class.java).get().sdkId.toUpperCamelCase() + "Client"
return ctx.service.getTrait(ServiceTrait::class.java).get().sdkId.toUpperCamelCase().removeSuffix("Service") + "Client"
}

override fun renderCustomFilePrivateVariables(writer: SwiftWriter) {
Expand Down
46 changes: 46 additions & 0 deletions scripts/run-every-smoke-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# This is a convenience script for developers for running every smoke test under SmokeTests/.
# The script must be run from aws-sdk-swift/, the directory containing SmokeTests/.

# cd into test module dir
cd SmokeTests/ || { echo "ERROR: Failed to change directory to SmokeTests."; exit 1; }

# Build and discard output for clean log
echo "INFO: Building SmokeTests module..."
swift build > /dev/null 2>&1

# Header print helpers
print_header() {
print_spacer
local header=$1
echo "##### $header #####"
print_spacer
}

print_spacer() {
echo ""
}

# Build and run each and every test runner; save result to results array
print_header "TEST RUNS"
results=()
for runnerName in ./*; do
if [ -d "$runnerName" ]; then
swift run "${runnerName#./}"
if [ $? -eq 0 ]; then
# Record success
results+=("SUCCESS: ${runnerName#./}")
else
# record failure
results+=("FAILURE: ${runnerName#./}")
fi
print_spacer
fi
done

# Print result summary
print_header "TEST RESULT SUMMARY"
for result in "${results[@]}"; do
echo "$result"
done

0 comments on commit 19914a1

Please sign in to comment.