Skip to content
Open
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 internal/logging/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ func (l *fileHandler) Close() {
return
}

l.Emit(getContext("DEBUG", 1), "Closing logging handler")

close(l.quit)
l.wg.Wait()

Expand Down
8 changes: 5 additions & 3 deletions internal/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const (
WARNING = 4
WARN = 4
ERROR = 8
NOTICE = 16 //notice is like info but for really important stuff ;)
NOTICE = 16 // notice is like info but for really important stuff ;)
CRITICAL = 32
QUIET = ERROR | NOTICE | CRITICAL //setting for errors only
QUIET = ERROR | NOTICE | CRITICAL // setting for errors only
NORMAL = INFO | WARN | ERROR | NOTICE | CRITICAL // default setting - all besides debug
ALL = 255
NOTHING = 0
Expand Down Expand Up @@ -158,7 +158,9 @@ func (l *standardHandler) Printf(msg string, args ...interface{}) {
l.Emit(getContext("DBG", 1), logMsg, args...)
}

func (l *standardHandler) Close() {}
func (l *standardHandler) Close() {
l.Emit(getContext("DEBUG", 1), "Closing logging handler")
}

var currentHandler LoggingHandler = &standardHandler{
DefaultFormatter,
Expand Down
2 changes: 1 addition & 1 deletion pkg/projectfile/projectfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ func AddLockInfo(projectFilePath, branch, version string) error {

projectRegex := regexp.MustCompile(fmt.Sprintf("(?m:(^project:\\s*%s))", ProjectURLRe))
lockString := fmt.Sprintf("%s@%s", branch, version)
lockUpdate := []byte(fmt.Sprintf(`${1}\nlock: %s`, lockString))
lockUpdate := []byte(fmt.Sprintf("${1}\nlock: %s", lockString))

data, err = os.ReadFile(projectFilePath)
if err != nil {
Expand Down
11 changes: 10 additions & 1 deletion test/integration/publish_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"
"regexp"
"runtime"
"testing"
"time"

Expand Down Expand Up @@ -32,6 +33,14 @@ func (suite *PublishIntegrationTestSuite) TestPublish() {
// For development convenience, should not be committed without commenting out..
// os.Setenv(constants.APIHostEnvVarName, "pr13375.activestate.build")

// Set EDITOR environment variable for testing purposes
if runtime.GOOS == "windows" {
suite.Require().NoError(os.Setenv("EDITOR", "notepad.exe"))
} else {
suite.Require().NoError(os.Setenv("EDITOR", "nano"))
}
defer os.Unsetenv("EDITOR")

type input struct {
args []string
metafile *string
Expand Down Expand Up @@ -136,7 +145,7 @@ func (suite *PublishIntegrationTestSuite) TestPublish() {
},
expect{
[]string{},
"Expected file extension:",
"Expected file extension",
true,
1,
true,
Expand Down
16 changes: 9 additions & 7 deletions test/integration/use_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"runtime"
"testing"

"github.com/ActiveState/cli/internal/config"
"github.com/ActiveState/cli/internal/fileutils"
"github.com/ActiveState/cli/internal/locale"
"github.com/ActiveState/cli/internal/osutils"
Expand Down Expand Up @@ -124,12 +123,15 @@ func (suite *UseIntegrationTestSuite) TestReset() {
python3Exe := filepath.Join(ts.Dirs.DefaultBin, "python3"+osutils.ExeExtension)
suite.True(fileutils.TargetExists(python3Exe), python3Exe+" not found")

cfg, err := config.New()
suite.NoError(err)
rcfile, err := subshell.New(cfg).RcFile()
if runtime.GOOS != "windows" && fileutils.FileExists(rcfile) {
suite.NoError(err)
suite.Contains(string(fileutils.ReadFileUnsafe(rcfile)), ts.Dirs.DefaultBin, "PATH does not have your project in it")
if runtime.GOOS != "windows" {
var rcfile string
ts.WithEnv(func() {
var err error
rcfile, err = subshell.New(ts.Config()).RcFile()
suite.NoError(err)
})
suite.Require().FileExists(rcfile)
suite.Contains(string(fileutils.ReadFileUnsafe(rcfile)), ts.Dirs.DefaultBin, ts.DebugMessage("PATH does not have your project in it"))
}

cp = ts.Spawn("use", "reset")
Expand Down
Loading