Skip to content

Commit

Permalink
Merge pull request #5071 from aws/fix-cwlogstests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed Nov 15, 2023
2 parents ea713c0 + 9f7840f commit f73f738
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
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" {
Must(writeAPIEventStreamTestFile(g))
}
}

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

0 comments on commit f73f738

Please sign in to comment.