-
Notifications
You must be signed in to change notification settings - Fork 201
/
Copy pathcheck-semver-hazards
executable file
·38 lines (30 loc) · 1.07 KB
/
check-semver-hazards
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
# This script patches the new runtime crates into an old AWS SDK and runs tests
# to check for semver hazards, such as a `Storable` being in an unstable runtime crate.
C_YELLOW='\033[1;33m'
C_RESET='\033[0m'
if [ "$#" -ne 0 ]; then
echo "Unexpected arguments ignored"
fi
# Need to allow warnings since there may be deprecations that the old SDK uses
unset RUSTFLAGS
set -eux
echo -e "${C_YELLOW}# Patching SDK...${C_RESET}"
runtime-versioner patch-runtime \
--sdk-path "$(pwd)/aws-sdk-rust" \
--smithy-rs-path "$(pwd)/smithy-rs"
echo -e "${C_YELLOW}# Copying the SDK lockfile to aws-sdk-rust...${C_RESET}"
cp "$(pwd)/smithy-rs/aws/sdk/Cargo.lock" "$(pwd)/aws-sdk-rust/"
echo -e "${C_YELLOW}# Testing SDK...${C_RESET}"
for sdk in aws-sdk-rust/sdk/*; do
if ls "$sdk/tests" | grep -v '^endpoint_tests\.rs$'; then
echo -e "${C_YELLOW}# Testing ${sdk}...${C_RESET}"
pushd "$sdk" &>/dev/null
cargo test --all-features
popd &>/dev/null
fi
done