Skip to content

add stable order for smoke tests + restoring client codegen #3265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
import software.amazon.smithy.codegen.core.Symbol;

import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
import java.util.Map;
import java.util.TreeSet;

public final class CppImportContainer implements ImportContainer {

Expand All @@ -27,8 +29,8 @@ public CppImportContainer(String namespace) {
String clientNamespace = SmokeTestsParser.removeSpaces(namespace);
String folderNamespace = SmokeTestsParser.toKebabCase(namespace);
this.c2jNamespace = SmithyC2JNamespaceMap.getInstance().getC2JServiceName(folderNamespace);
this.coreHeaders = new HashSet<>();
this.dynamicHeaders = new HashSet<>();
this.coreHeaders = new TreeSet<>(Comparator.naturalOrder()); //This maintains lexicographical order
this.dynamicHeaders = new TreeSet<>(Comparator.naturalOrder());
Collections.addAll(coreHeaders,
"aws/core/client/AsyncCallerContext.h",
"aws/core/client/AsyncCallerContext.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Set;
import java.util.Comparator;

import software.amazon.smithy.build.PluginContext;
import software.amazon.smithy.aws.smoketests.model.AwsSmokeTestModel;
Expand Down Expand Up @@ -280,6 +281,7 @@ public Map<ServiceShape, List<SmokeTestData> > extractServiceSmokeTests()
filter(operationShape -> operationShape.getInput().isPresent()).
filter(operationShape -> operationShape.getTrait(SmokeTestsTrait.class).isPresent() ).
filter(operationShape -> operationToServiceMap.containsKey(operationShape.getId()) ).
sorted(Comparator.comparing(OperationShape::getId)).
forEach(operationShape -> {
SmokeTestsTrait smokeTestsTrait = operationShape.getTrait(SmokeTestsTrait.class).get();
//get serviceShape
Expand Down
4 changes: 2 additions & 2 deletions tools/scripts/run_code_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ def collect_available_models(models_dir: str, endpoint_rules_dir: str, legacy_ma
with open(models_dir + "/" + model_file_date[0], 'r') as json_file:
model = json.load(json_file)
#get service id. It has to exist, else continue
if ("metadata" in model and "serviceId" in model["metadata"]):
if "metadata" in model and any(k in model["metadata"] for k in ["serviceId", "serviceFullName"]):
if key not in legacy_mapped_services:
key = model["metadata"]["serviceId"]
key = model["metadata"].get("serviceId", model["metadata"].get("serviceFullName"))
#convert into smithy case convention
key = key.lower().replace(' ', '-')

Expand Down
Loading