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

Update ci #132

Merged
merged 6 commits into from Feb 13, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,27 @@
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.17
parallelism: 2
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run: make test
- save_cache:
key: go-mod-v4-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
- store_artifacts:
path: /tmp/test-results
destination: raw-test-output

- store_test_results:
path: /tmp/test-results
workflows:
version: 2
build-workflow:
jobs:
- build
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
# Spinner

[![GoDoc](https://godoc.org/github.com/briandowns/spinner?status.svg)](https://godoc.org/github.com/briandowns/spinner) [![Build Status](https://travis-ci.org/briandowns/spinner.svg?branch=master)](https://travis-ci.org/briandowns/spinner)
[![GoDoc](https://godoc.org/github.com/briandowns/spinner?status.svg)](https://godoc.org/github.com/briandowns/spinner) [![CircleCI](https://circleci.com/gh/briandowns/spinner.svg?style=svg)](https://circleci.com/gh/briandowns/spinner)

spinner is a simple package to add a spinner / progress indicator to any terminal application. Examples can be found below as well as full examples in the examples directory.

Expand Down
11 changes: 11 additions & 0 deletions spinner_test.go
Expand Up @@ -18,10 +18,13 @@ import (
"bytes"
"fmt"
"io/ioutil"
"os"
"reflect"
"sync"
"testing"
"time"

"github.com/mattn/go-isatty"
)

const baseWait = 3
Expand Down Expand Up @@ -69,6 +72,10 @@ func TestStart(t *testing.T) {

// TestActive will verify we can tell when a spinner is running
func TestActive(t *testing.T) {
if !isatty.IsTerminal(os.Stdout.Fd()) {
t.Log("not running in a terminal")
return
}
s := New(CharSets[1], 100*time.Millisecond)
if s.Active() {
t.Error("expected a new spinner to not be active")
Expand Down Expand Up @@ -127,6 +134,10 @@ func TestRestart(t *testing.T) {

// TestHookFunctions will verify that hook functions works as expected
func TestHookFunctions(t *testing.T) {
if !isatty.IsTerminal(os.Stdout.Fd()) {
t.Log("not running in a termian")
Copy link

@theckman theckman Feb 13, 2022

Choose a reason for hiding this comment

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

@briandowns you got a typo here.

return
}
s := New(CharSets[4], 50*time.Millisecond)
var out syncBuffer
s.Writer = &out
Expand Down