Skip to content
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

don't generate cloudwatchlogs event streams tests for now #5071

Merged
merged 1 commit into from
Nov 15, 2023
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
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
### SDK Enhancements

### SDK Bugs
* Don't generate cloudwatchlogs event streams tests for now.
* The test harness does not handle event stream APIs with a host prefix at this time.
17 changes: 11 additions & 6 deletions private/model/cli/gen-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
// Command aws-gen-gocli parses a JSON description of an AWS API and generates a
// Go file containing a client for the API.
//
// aws-gen-gocli apis/s3/2006-03-03/api-2.json
// aws-gen-gocli apis/s3/2006-03-03/api-2.json
package main

import (
"flag"
"fmt"
"github.com/aws/aws-sdk-go/private/model/api"
"github.com/aws/aws-sdk-go/private/util"
"io/ioutil"
"os"
"path/filepath"
"runtime/debug"
"strings"
"sync"

"github.com/aws/aws-sdk-go/private/model/api"
"github.com/aws/aws-sdk-go/private/util"
)

func usage() {
Expand All @@ -43,7 +44,8 @@ Flags:`)
// -path alternative service path to write generated files to for each service.
//
// Env:
// SERVICES comma separated list of services to generate.
//
// SERVICES comma separated list of services to generate.
func main() {
var svcPath, svcImportPath string
flag.StringVar(&svcPath, "path", "service",
Expand Down Expand Up @@ -162,7 +164,7 @@ func writeServiceFiles(g *generateInfo, pkgDir string) {
defer func() {
if r := recover(); r != nil {
fmt.Fprintf(os.Stderr, "Error generating %s\n%s\n%s\n",
pkgDir, r, string(debug.Stack()))
pkgDir, r, string(debug.Stack()))
os.Exit(1)
}
}()
Expand All @@ -180,7 +182,10 @@ func writeServiceFiles(g *generateInfo, pkgDir string) {
Must(writeExamplesFile(g))

if g.API.HasEventStream {
Must(writeAPIEventStreamTestFile(g))
// has stream APIs with host prefix, which our tests break on, skip codegen for now
if g.API.PackageName() != "cloudwatchlogs" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why not combine 2 if judgement together like this
if g.API.HasEventStream && g.API.PackageName() != "cloudwatchlogs"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at first glance we should not hard code the cloudwatchlogs and its tests, but this is the best solution up to now

Copy link
Contributor Author

@lucix-aws lucix-aws Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly just to isolate the cloudwatch check so it's minimally less effort to rip out if we ever fix this (or extend it if we have to)

Must(writeAPIEventStreamTestFile(g))
}
}

if g.API.PackageName() == "s3" {
Expand Down