|  | 
| 14 | 14 | # | 
| 15 | 15 | # ``` | 
| 16 | 16 | # $ cd test/smithy-rs | 
| 17 |  | -# $ ../../smithy-rs/tools/codegen-diff-revisions.py . <some commit hash to diff against> | 
|  | 17 | +# $ ../../smithy-rs/tools/ci-scripts/codegen-diff-revisions.py . <some commit hash to diff against> | 
| 18 | 18 | # ``` | 
| 19 | 19 | # | 
| 20 | 20 | # It will diff the generated code from HEAD against any commit hash you feed it. If you want to test | 
| 21 | 21 | # a specific range, change the HEAD of the test repository. | 
| 22 | 22 | # | 
| 23 |  | -# This script requires `diff2html-cli` to be installed from NPM: | 
|  | 23 | +# This script requires `difftags` to be installed from `tools/ci-build/difftags`: | 
| 24 | 24 | # ``` | 
| 25 |  | -# $ npm install -g [email protected] | 
|  | 25 | +# $ cargo install --path tools/ci-build/difftags | 
| 26 | 26 | # ``` | 
| 27 | 27 | # Make sure the local version matches the version referenced from the GitHub Actions workflow. | 
| 28 | 28 | 
 | 
| 29 | 29 | import os | 
| 30 | 30 | import sys | 
| 31 | 31 | import subprocess | 
| 32 |  | -import tempfile | 
| 33 | 32 | import shlex | 
| 34 | 33 | 
 | 
| 35 | 34 | 
 | 
| @@ -94,15 +93,15 @@ def generate_and_commit_generated_code(revision_sha): | 
| 94 | 93 | 
 | 
| 95 | 94 |     # Generate code | 
| 96 | 95 |     run("./gradlew --rerun-tasks aws:sdk:assemble codegen-client-test:assemble codegen-server-test:assemble") | 
| 97 |  | -    run("cd rust-runtime/aws-smithy-http-server-python/examples && make build", shell=True) | 
|  | 96 | +    run("cd rust-runtime/aws-smithy-http-server-python/examples && make build", shell=True, check=False) | 
| 98 | 97 | 
 | 
| 99 | 98 |     # Move generated code into codegen-diff/ directory | 
| 100 | 99 |     run(f"rm -rf {OUTPUT_PATH}") | 
| 101 | 100 |     run(f"mkdir {OUTPUT_PATH}") | 
| 102 | 101 |     run(f"mv aws/sdk/build/aws-sdk {OUTPUT_PATH}/") | 
| 103 | 102 |     run(f"mv codegen-client-test/build/smithyprojections/codegen-client-test {OUTPUT_PATH}/") | 
| 104 | 103 |     run(f"mv codegen-server-test/build/smithyprojections/codegen-server-test {OUTPUT_PATH}/") | 
| 105 |  | -    run(f"mv rust-runtime/aws-smithy-http-server-python/examples/pokemon-service-server-sdk/ {OUTPUT_PATH}/codegen-server-test-python/") | 
|  | 104 | +    run(f"mv rust-runtime/aws-smithy-http-server-python/examples/pokemon-service-server-sdk/ {OUTPUT_PATH}/codegen-server-test-python/", check=False) | 
| 106 | 105 | 
 | 
| 107 | 106 |     # Clean up the SDK directory | 
| 108 | 107 |     run(f"rm -f {OUTPUT_PATH}/aws-sdk/versions.toml") | 
| @@ -201,10 +200,10 @@ def eprint(*args, **kwargs): | 
| 201 | 200 | 
 | 
| 202 | 201 | 
 | 
| 203 | 202 | # Runs a shell command | 
| 204 |  | -def run(command, shell=False): | 
|  | 203 | +def run(command, shell=False, check=True): | 
| 205 | 204 |     if not shell: | 
| 206 | 205 |         command = shlex.split(command) | 
| 207 |  | -    subprocess.run(command, stdout=sys.stderr, stderr=sys.stderr, shell=shell, check=True) | 
|  | 206 | +    subprocess.run(command, stdout=sys.stderr, stderr=sys.stderr, shell=shell, check=check) | 
| 208 | 207 | 
 | 
| 209 | 208 | 
 | 
| 210 | 209 | # Returns the output from a shell command. Bails if the command failed | 
|  | 
0 commit comments