-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1066 from CircleCI-Public/develop
Cut a new CLI release
- Loading branch information
Showing
5 changed files
with
116 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package runner | ||
|
||
import ( | ||
"net/http" | ||
"net/http/httptest" | ||
"testing" | ||
|
||
"gotest.tools/v3/assert" | ||
"gotest.tools/v3/assert/cmp" | ||
|
||
"github.com/CircleCI-Public/circleci-cli/settings" | ||
) | ||
|
||
func Test_NewCommand(t *testing.T) { | ||
t.Run("Runner uses /api/v3", func(t *testing.T) { | ||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
assert.Check(t, cmp.Equal(r.URL.EscapedPath(), "/api/v3/runner")) | ||
|
||
w.Header().Set("Content-Type", "application/json") | ||
_, err := w.Write([]byte(`{"items":[]}`)) | ||
assert.NilError(t, err) | ||
w.WriteHeader(http.StatusOK) | ||
})) | ||
t.Cleanup(server.Close) | ||
|
||
cmd := NewCommand(&settings.Config{Host: server.URL, HTTPClient: &http.Client{}}, nil) | ||
cmd.SetArgs([]string{"instance", "ls", "my-namespace"}) | ||
err := cmd.Execute() | ||
assert.NilError(t, err) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,30 +84,6 @@ Feature: Config checking | |
Then the exit status should be 0 | ||
And the output should contain "Config file at config.yml is valid" | ||
|
||
Scenario: Checking a valid config file with a private org | ||
Given a file named "config.yml" with: | ||
""" | ||
version: 2.1 | ||
orbs: | ||
node: circleci/[email protected] | ||
jobs: | ||
datadog-hello-world: | ||
docker: | ||
- image: cimg/base:stable | ||
steps: | ||
- run: | | ||
echo "doing something really cool" | ||
workflows: | ||
datadog-hello-world: | ||
jobs: | ||
- datadog-hello-world | ||
""" | ||
When I run `circleci config validate --skip-update-check --org-id bb604b45-b6b0-4b81-ad80-796f15eddf87 -c config.yml` | ||
Then the output should contain "Config file at config.yml is valid" | ||
And the exit status should be 0 | ||
|
||
Scenario: Checking a valid config file with a non-existant orb | ||
Given a file named "config.yml" with: | ||
""" | ||
|