diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2eb8209..7c77f9b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.64" + ".": "0.1.0-alpha.65" } diff --git a/.stats.yml b/.stats.yml index 3ad25f7..f0b2dba 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-6783cf45e0ea6644994eae08c41f755e29948bee313a6c2aaf5b710253eb4eaa.yml -openapi_spec_hash: b37f9ad1ca6bce774c6448b28d267bec +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-14899ed94f51eb27170c1618fcdb134c6df08db90996eeec2f620eb8d84c604a.yml +openapi_spec_hash: a4cf6948697a56d5b07ad48ef133093b config_hash: f1b8a43873719fc8f2789008f3aa2260 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f7e101..75bebb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## 0.1.0-alpha.65 (2025-12-22) + +Full Changelog: [v0.1.0-alpha.64...v0.1.0-alpha.65](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.64...v0.1.0-alpha.65) + +### Features + +* added mock server tests ([f62abc2](https://github.com/stainless-api/stainless-api-cli/commit/f62abc2e06e2a0f85e57a22a956e3d9272fd65b2)) + + +### Bug Fixes + +* base64 encoding regression ([967d82c](https://github.com/stainless-api/stainless-api-cli/commit/967d82c469ec3f7aca4946c2f3bd4a32f848f7df)) +* fix generated flag types and value wrapping ([b8293dc](https://github.com/stainless-api/stainless-api-cli/commit/b8293dcb107347ac57b692d540951b3c09350914)) + + +### Chores + +* **cli:** run pre-codegen tests on Windows ([7dd0ffb](https://github.com/stainless-api/stainless-api-cli/commit/7dd0ffba4c671678883eedb41b29dd1816b970da)) +* **internal:** codegen related update ([c439ed6](https://github.com/stainless-api/stainless-api-cli/commit/c439ed63774cae542fa6eac8d01095a272061be9)) +* **internal:** codegen related update ([f9e9d7d](https://github.com/stainless-api/stainless-api-cli/commit/f9e9d7dbcca54b2df0cde1c84e4bc65f525ef786)) + ## 0.1.0-alpha.64 (2025-12-17) Full Changelog: [v0.1.0-alpha.63...v0.1.0-alpha.64](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.63...v0.1.0-alpha.64) diff --git a/internal/binaryparam/binary_param_test.go b/internal/binaryparam/binary_param_test.go index 243550e..bdac3e9 100644 --- a/internal/binaryparam/binary_param_test.go +++ b/internal/binaryparam/binary_param_test.go @@ -34,6 +34,7 @@ func TestFileOrStdin(t *testing.T) { stubStdin, err := os.Open(tempFile) require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, stubStdin.Close()) }) readCloser, stdinInUse, err := FileOrStdin(stubStdin, "-") require.NoError(t, err) @@ -51,6 +52,7 @@ func TestFileOrStdin(t *testing.T) { stubStdin, err := os.Open(tempFile) require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, stubStdin.Close()) }) readCloser, stdinInUse, err := FileOrStdin(stubStdin, "/dev/fd/0") require.NoError(t, err) @@ -68,6 +70,7 @@ func TestFileOrStdin(t *testing.T) { stubStdin, err := os.Open(tempFile) require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, stubStdin.Close()) }) readCloser, stdinInUse, err := FileOrStdin(stubStdin, "/dev/stdin") require.NoError(t, err) diff --git a/internal/mocktest/mocktest.go b/internal/mocktest/mocktest.go new file mode 100644 index 0000000..575ae89 --- /dev/null +++ b/internal/mocktest/mocktest.go @@ -0,0 +1,96 @@ +package mocktest + +import ( + "context" + "fmt" + "net" + "net/http" + "net/url" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var mockServerURL *url.URL + +func init() { + mockServerURL, _ = url.Parse("http://localhost:4010") + if testURL := os.Getenv("TEST_API_BASE_URL"); testURL != "" { + if parsed, err := url.Parse(testURL); err == nil { + mockServerURL = parsed + } + } +} + +// OnlyMockServerDialer only allows network connections to the mock server +type OnlyMockServerDialer struct{} + +func (d *OnlyMockServerDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) { + if address == mockServerURL.Host { + return (&net.Dialer{}).DialContext(ctx, network, address) + } + + return nil, fmt.Errorf("BLOCKED: connection to %s not allowed (only allowed: %s)", address, mockServerURL.Host) +} + +func blockNetworkExceptMockServer() (http.RoundTripper, http.RoundTripper) { + restricted := &http.Transport{ + DialContext: (&OnlyMockServerDialer{}).DialContext, + } + + origClient, origDefault := http.DefaultClient.Transport, http.DefaultTransport + http.DefaultClient.Transport, http.DefaultTransport = restricted, restricted + return origClient, origDefault +} + +func restoreNetwork(origClient, origDefault http.RoundTripper) { + http.DefaultClient.Transport, http.DefaultTransport = origClient, origDefault +} + +// TestRunMockTestWithFlags runs a test against a mock server with the provided +// CLI flags and ensures it succeeds +func TestRunMockTestWithFlags(t *testing.T, flags ...string) { + origClient, origDefault := blockNetworkExceptMockServer() + defer restoreNetwork(origClient, origDefault) + + // Check if mock server is running + conn, err := net.DialTimeout("tcp", mockServerURL.Host, 2*time.Second) + if err != nil { + require.Fail(t, "Mock server is not running on "+mockServerURL.Host+". Please start the mock server before running tests.") + } else { + conn.Close() + } + + // Get the path to the main command + _, filename, _, ok := runtime.Caller(0) + require.True(t, ok, "Could not get current file path") + dirPath := filepath.Dir(filename) + project := filepath.Join(dirPath, "..", "..", "cmd", "...") + + args := []string{"run", project, "--base-url", mockServerURL.String()} + args = append(args, flags...) + + t.Logf("Testing command: stl %s", strings.Join(args[4:], " ")) + + cmd := exec.Command("go", args...) + output, err := cmd.CombinedOutput() + if err != nil { + assert.Fail(t, "Test failed", "Error: %v\nOutput: %s", err, output) + } + + t.Logf("Test passed successfully with output:\n%s\n", output) +} + +func TestFile(t *testing.T, contents string) string { + tmpDir := t.TempDir() + filename := filepath.Join(tmpDir, "file.txt") + require.NoError(t, os.WriteFile(filename, []byte(contents), 0644)) + return filename +} diff --git a/internal/requestflag/requestflag.go b/internal/requestflag/requestflag.go index 4b1177c..a663cdc 100644 --- a/internal/requestflag/requestflag.go +++ b/internal/requestflag/requestflag.go @@ -564,7 +564,7 @@ func (d *DateValue) Parse(s string) error { func (d *DateTimeValue) Parse(s string) error { formats := []string{ time.RFC3339, - "2006-01-02T15:04:05Z07:00", + time.RFC3339Nano, "2006-01-02T15:04:05", "2006-01-02 15:04:05", time.RFC1123, @@ -584,6 +584,7 @@ func (d *DateTimeValue) Parse(s string) error { func (t *TimeValue) Parse(s string) error { formats := []string{ "15:04:05", + "15:04:05.999999999Z07:00", "3:04:05PM", "3:04 PM", "15:04", diff --git a/pkg/cmd/build.go b/pkg/cmd/build.go index 61056a2..4e68f26 100644 --- a/pkg/cmd/build.go +++ b/pkg/cmd/build.go @@ -113,7 +113,7 @@ var buildsCreate = cli.Command{ Usage: "Optional commit message to use when creating a new commit.", BodyPath: "commit_message", }, - &requestflag.Flag[any]{ + &requestflag.Flag[map[string]string]{ Name: "target-commit-messages", Usage: "Optional commit messages to use for each SDK when making a new commit.\nSDKs not represented in this object will fallback to the optional\n`commit_message` parameter, or will fallback further to the default\ncommit message.", BodyPath: "target_commit_messages", @@ -184,12 +184,12 @@ var buildsCompare = cli.Command{ Name: "compare", Usage: "Create two builds whose outputs can be directly compared with each other.", Flags: []cli.Flag{ - &requestflag.Flag[any]{ + &requestflag.Flag[map[string]any]{ Name: "base", Usage: "Parameters for the base build", BodyPath: "base", }, - &requestflag.Flag[any]{ + &requestflag.Flag[map[string]any]{ Name: "head", Usage: "Parameters for the head build", BodyPath: "head", @@ -246,16 +246,16 @@ func handleBuildsCreate(ctx context.Context, cmd *cli.Command) error { if name, oas, err := convertFileFlag(cmd, "openapi-spec"); err != nil { return err } else if oas != nil { - modifyYAML(cmd, "revision", gjson.Escape("openapi"+path.Ext(name)), map[string][]byte{ - "content": oas, + modifyYAML(cmd, "revision", gjson.Escape("openapi"+path.Ext(name)), map[string]string{ + "content": string(oas), }) } if name, config, err := convertFileFlag(cmd, "stainless-config"); err != nil { return err } else if config != nil { - modifyYAML(cmd, "revision", gjson.Escape("stainless"+path.Ext(name)), map[string][]byte{ - "content": config, + modifyYAML(cmd, "revision", gjson.Escape("stainless"+path.Ext(name)), map[string]string{ + "content": string(config), }) } diff --git a/pkg/cmd/build_test.go b/pkg/cmd/build_test.go new file mode 100644 index 0000000..cef695c --- /dev/null +++ b/pkg/cmd/build_test.go @@ -0,0 +1,58 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "testing" + + "github.com/stainless-api/stainless-api-cli/internal/mocktest" +) + +func TestBuildsCreate(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "builds", "create", + "--project", "project", + "--revision", "string", + "--allow-empty", + "--branch", "branch", + "--commit-message", "commit_message", + "--target-commit-messages", "{cli: cli, csharp: csharp, go: go, java: java, kotlin: kotlin, node: node, openapi: openapi, php: php, python: python, ruby: ruby, terraform: terraform, typescript: typescript}", + "--target", "node", + ) +} + +func TestBuildsRetrieve(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "builds", "retrieve", + "--build-id", "buildId", + ) +} + +func TestBuildsList(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "builds", "list", + "--project", "project", + "--branch", "branch", + "--cursor", "cursor", + "--limit", "1", + "--revision", "string", + ) +} + +func TestBuildsCompare(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "builds", "compare", + "--base", "{branch: branch, revision: string, commit_message: commit_message}", + "--head", "{branch: branch, revision: string, commit_message: commit_message}", + "--project", "project", + "--target", "node", + ) +} diff --git a/pkg/cmd/builddiagnostic_test.go b/pkg/cmd/builddiagnostic_test.go new file mode 100644 index 0000000..85ab3a9 --- /dev/null +++ b/pkg/cmd/builddiagnostic_test.go @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "testing" + + "github.com/stainless-api/stainless-api-cli/internal/mocktest" +) + +func TestBuildsDiagnosticsList(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "builds:diagnostics", "list", + "--build-id", "buildId", + "--cursor", "cursor", + "--limit", "1", + "--severity", "fatal", + "--targets", "targets", + ) +} diff --git a/pkg/cmd/buildtargetoutput_test.go b/pkg/cmd/buildtargetoutput_test.go new file mode 100644 index 0000000..089d742 --- /dev/null +++ b/pkg/cmd/buildtargetoutput_test.go @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "testing" + + "github.com/stainless-api/stainless-api-cli/internal/mocktest" +) + +func TestBuildsTargetOutputsRetrieve(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "builds:target-outputs", "retrieve", + "--build-id", "build_id", + "--target", "node", + "--type", "source", + "--output", "url", + ) +} diff --git a/pkg/cmd/cmdutil.go b/pkg/cmd/cmdutil.go index 77a1402..19b91f2 100644 --- a/pkg/cmd/cmdutil.go +++ b/pkg/cmd/cmdutil.go @@ -48,7 +48,7 @@ func getDefaultRequestOptions(cmd *cli.Command) []option.RequestOption { case "staging": opts = append(opts, option.WithEnvironmentStaging()) default: - log.Fatalf("Unknown environment: %s. Valid environments are: production, staging", environment) + log.Fatalf("Unknown environment: %s. Valid environments are %s", environment, "production, staging") } } diff --git a/pkg/cmd/flagoptions.go b/pkg/cmd/flagoptions.go index a930241..ad8cdff 100644 --- a/pkg/cmd/flagoptions.go +++ b/pkg/cmd/flagoptions.go @@ -24,6 +24,7 @@ const ( EmptyBody BodyContentType = iota MultipartFormEncoded ApplicationJSON + ApplicationOctetStream ) func flagOptions( @@ -125,12 +126,23 @@ func flagOptions( return nil, err } options = append(options, option.WithRequestBody(writer.FormDataContentType(), buf)) + case ApplicationJSON: bodyBytes, err := json.Marshal(bodyData) if err != nil { return nil, err } options = append(options, option.WithRequestBody("application/json", bodyBytes)) + + case ApplicationOctetStream: + if bodyBytes, ok := bodyData.([]byte); ok { + options = append(options, option.WithRequestBody("application/octet-stream", bodyBytes)) + } else if bodyStr, ok := bodyData.(string); ok { + options = append(options, option.WithRequestBody("application/octet-stream", []byte(bodyStr))) + } else { + return nil, fmt.Errorf("Unsupported body for application/octet-stream: %v", bodyData) + } + default: panic("Invalid body content type!") } diff --git a/pkg/cmd/org_test.go b/pkg/cmd/org_test.go new file mode 100644 index 0000000..3b2a552 --- /dev/null +++ b/pkg/cmd/org_test.go @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "testing" + + "github.com/stainless-api/stainless-api-cli/internal/mocktest" +) + +func TestOrgsRetrieve(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "orgs", "retrieve", + "--org", "org", + ) +} + +func TestOrgsList(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "orgs", "list", + ) +} diff --git a/pkg/cmd/project.go b/pkg/cmd/project.go index 04582b4..9b602bf 100644 --- a/pkg/cmd/project.go +++ b/pkg/cmd/project.go @@ -29,7 +29,7 @@ var projectsCreate = cli.Command{ Usage: "Organization name", BodyPath: "org", }, - &requestflag.Flag[any]{ + &requestflag.Flag[map[string]map[string]string]{ Name: "revision", Usage: "File contents to commit", BodyPath: "revision", @@ -149,7 +149,7 @@ func handleProjectsRetrieve(ctx context.Context, cmd *cli.Command) error { } params := stainless.ProjectGetParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( @@ -185,7 +185,7 @@ func handleProjectsUpdate(ctx context.Context, cmd *cli.Command) error { } params := stainless.ProjectUpdateParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( diff --git a/pkg/cmd/project_test.go b/pkg/cmd/project_test.go new file mode 100644 index 0000000..6da4205 --- /dev/null +++ b/pkg/cmd/project_test.go @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "testing" + + "github.com/stainless-api/stainless-api-cli/internal/mocktest" +) + +func TestProjectsCreate(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects", "create", + "--display-name", "display_name", + "--org", "org", + "--revision", "{foo: {content: content}}", + "--slug", "slug", + "--target", "node", + ) +} + +func TestProjectsRetrieve(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects", "retrieve", + "--project", "project", + ) +} + +func TestProjectsUpdate(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects", "update", + "--project", "project", + "--display-name", "display_name", + ) +} + +func TestProjectsList(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects", "list", + "--cursor", "cursor", + "--limit", "1", + "--org", "org", + ) +} diff --git a/pkg/cmd/projectbranch.go b/pkg/cmd/projectbranch.go index 4c7c25c..6b65612 100644 --- a/pkg/cmd/projectbranch.go +++ b/pkg/cmd/projectbranch.go @@ -153,7 +153,7 @@ func handleProjectsBranchesCreate(ctx context.Context, cmd *cli.Command) error { } params := stainless.ProjectBranchNewParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( @@ -192,7 +192,7 @@ func handleProjectsBranchesRetrieve(ctx context.Context, cmd *cli.Command) error } params := stainless.ProjectBranchGetParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( @@ -233,7 +233,7 @@ func handleProjectsBranchesList(ctx context.Context, cmd *cli.Command) error { } params := stainless.ProjectBranchListParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( @@ -285,7 +285,7 @@ func handleProjectsBranchesDelete(ctx context.Context, cmd *cli.Command) error { } params := stainless.ProjectBranchDeleteParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( @@ -329,7 +329,7 @@ func handleProjectsBranchesRebase(ctx context.Context, cmd *cli.Command) error { } params := stainless.ProjectBranchRebaseParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( @@ -373,7 +373,7 @@ func handleProjectsBranchesReset(ctx context.Context, cmd *cli.Command) error { } params := stainless.ProjectBranchResetParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( diff --git a/pkg/cmd/projectbranch_test.go b/pkg/cmd/projectbranch_test.go new file mode 100644 index 0000000..78f6777 --- /dev/null +++ b/pkg/cmd/projectbranch_test.go @@ -0,0 +1,74 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "testing" + + "github.com/stainless-api/stainless-api-cli/internal/mocktest" +) + +func TestProjectsBranchesCreate(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects:branches", "create", + "--project", "project", + "--branch", "branch", + "--branch-from", "branch_from", + "--force", + ) +} + +func TestProjectsBranchesRetrieve(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects:branches", "retrieve", + "--project", "project", + "--branch", "branch", + ) +} + +func TestProjectsBranchesList(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects:branches", "list", + "--project", "project", + "--cursor", "cursor", + "--limit", "1", + ) +} + +func TestProjectsBranchesDelete(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects:branches", "delete", + "--project", "project", + "--branch", "branch", + ) +} + +func TestProjectsBranchesRebase(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects:branches", "rebase", + "--project", "project", + "--branch", "branch", + "--base", "base", + ) +} + +func TestProjectsBranchesReset(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects:branches", "reset", + "--project", "project", + "--branch", "branch", + "--target-config-sha", "target_config_sha", + ) +} diff --git a/pkg/cmd/projectconfig.go b/pkg/cmd/projectconfig.go index 2cea8ff..7476af3 100644 --- a/pkg/cmd/projectconfig.go +++ b/pkg/cmd/projectconfig.go @@ -73,7 +73,7 @@ func handleProjectsConfigsRetrieve(ctx context.Context, cmd *cli.Command) error } params := stainless.ProjectConfigGetParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( @@ -109,7 +109,7 @@ func handleProjectsConfigsGuess(ctx context.Context, cmd *cli.Command) error { } params := stainless.ProjectConfigGuessParams{ - Project: stainless.Opt(cmd.Value("project").(string)), + Project: stainless.String(cmd.Value("project").(string)), } options, err := flagOptions( diff --git a/pkg/cmd/projectconfig_test.go b/pkg/cmd/projectconfig_test.go new file mode 100644 index 0000000..d4a8002 --- /dev/null +++ b/pkg/cmd/projectconfig_test.go @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "testing" + + "github.com/stainless-api/stainless-api-cli/internal/mocktest" +) + +func TestProjectsConfigsRetrieve(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects:configs", "retrieve", + "--project", "project", + "--branch", "branch", + "--include", "include", + ) +} + +func TestProjectsConfigsGuess(t *testing.T) { + t.Skip("Prism tests are disabled") + mocktest.TestRunMockTestWithFlags( + t, + "projects:configs", "guess", + "--project", "project", + "--spec", "spec", + "--branch", "branch", + ) +} diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index ab588c8..e974bd7 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -2,4 +2,4 @@ package cmd -const Version = "0.1.0-alpha.64" // x-release-please-version +const Version = "0.1.0-alpha.65" // x-release-please-version diff --git a/scripts/test b/scripts/test index a5cee9f..7383fc5 100755 --- a/scripts/test +++ b/scripts/test @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -euo pipefail cd "$(dirname "$0")/.." @@ -22,7 +22,7 @@ kill_server_on_port() { } function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] + [ -n "${TEST_API_BASE_URL:-}" ] } if ! is_overriding_api_base_url && ! prism_is_running ; then