-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing unset command on multiple runs; Fixing stack list indicator; A…
…dding changie;
- Loading branch information
1 parent
e2fab95
commit 5bdbf86
Showing
18 changed files
with
209 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## 0.3.1 - 2024-02-28 | ||
### Fixed | ||
* Bug where listing stacks when no stack is currently selected adds an inidicator to every stack | ||
* unset command erroring out if no stack is active |
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,6 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), | ||
and is generated by [Changie](https://github.com/miniscruff/changie). |
Empty file.
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 @@ | ||
changesDir: .changes | ||
unreleasedDir: unreleased | ||
headerPath: header.tpl.md | ||
changelogPath: CHANGELOG.md | ||
versionExt: md | ||
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}' | ||
kindFormat: '### {{.Kind}}' | ||
changeFormat: '* {{.Body}}' | ||
kinds: | ||
- label: Added | ||
auto: minor | ||
- label: Changed | ||
auto: major | ||
- label: Deprecated | ||
auto: minor | ||
- label: Removed | ||
auto: major | ||
- label: Fixed | ||
auto: patch | ||
- label: Security | ||
auto: patch | ||
newlines: | ||
afterChangelogHeader: 1 | ||
beforeChangelogVersion: 1 | ||
endOfVersion: 1 | ||
envPrefix: CHANGIE_ | ||
|
||
custom: | ||
- key: Author | ||
label: Github Name | ||
type: string |
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 |
---|---|---|
|
@@ -37,6 +37,7 @@ archives: | |
format: zip | ||
|
||
changelog: | ||
disable: false | ||
sort: asc | ||
filters: | ||
exclude: | ||
|
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,9 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), | ||
and is generated by [Changie](https://github.com/miniscruff/changie). | ||
|
||
|
||
No releases yet, this file will be updated when generating your first release. |
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
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 |
---|---|---|
@@ -1 +1,98 @@ | ||
package models | ||
|
||
import ( | ||
"fmt" | ||
"github.com/Shackelford-Arden/hctx/types" | ||
"testing" | ||
) | ||
|
||
// region Bash/ZSH | ||
|
||
func TestNewConfigUseFullNomad(t *testing.T) { | ||
|
||
cfg, err := NewConfig("testdata/fullNomad.hcl") | ||
if err != nil { | ||
t.Fatalf("failed to read config: %s", err) | ||
} | ||
|
||
stackName := "just_nomad" | ||
useOut := cfg.StackExists(stackName).Use("bash") | ||
|
||
expectedOutput := fmt.Sprintf(` | ||
export %s='%s' | ||
export %s=http://localhost:4646 | ||
export %s=default`, | ||
types.StackNameEnv, stackName, NomadAddr, NomadNamespace) | ||
|
||
if useOut != expectedOutput { | ||
t.Fatalf("\nExpected: %s\nActual: %s", expectedOutput, useOut) | ||
} | ||
|
||
} | ||
|
||
func TestNewConfigUseFullConsul(t *testing.T) { | ||
|
||
cfg, err := NewConfig("testdata/fullConsul.hcl") | ||
if err != nil { | ||
t.Fatalf("failed to read config: %s", err) | ||
} | ||
stackName := "just_consul" | ||
useOut := cfg.StackExists(stackName).Use("bash") | ||
|
||
expectedOutput := fmt.Sprintf(` | ||
export %s='%s' | ||
export %s=http://localhost:8500 | ||
export %s=default`, | ||
types.StackNameEnv, stackName, ConsulAddr, ConsulNamespace) | ||
|
||
if useOut != expectedOutput { | ||
t.Fatalf("\nExpected: %s\nActual: %s", expectedOutput, useOut) | ||
} | ||
|
||
} | ||
|
||
func TestNewConfigUseFullVault(t *testing.T) { | ||
|
||
cfg, err := NewConfig("testdata/fullVault.hcl") | ||
if err != nil { | ||
t.Fatalf("failed to read config: %s", err) | ||
} | ||
|
||
stackName := "just_vault" | ||
useOut := cfg.StackExists(stackName).Use("bash") | ||
|
||
expectedOutput := fmt.Sprintf(` | ||
export %s='%s' | ||
export %s=http://localhost:8200 | ||
export %s=default`, | ||
types.StackNameEnv, stackName, VaultAddr, VaultNamespace) | ||
|
||
if useOut != expectedOutput { | ||
t.Fatalf("\nExpected: %s\nActual: %s", expectedOutput, useOut) | ||
} | ||
|
||
} | ||
|
||
func TestNewConfigUnsetNomad(t *testing.T) { | ||
|
||
cfg, err := NewConfig("testdata/fullNomad.hcl") | ||
if err != nil { | ||
t.Errorf("failed to read config: %s", err) | ||
} | ||
|
||
stackName := "just_nomad" | ||
unsetOut := cfg.StackExists(stackName).Unset("bash") | ||
|
||
expectedOutput := fmt.Sprintf(` | ||
unset %s | ||
unset %s | ||
unset %s`, | ||
types.StackNameEnv, NomadAddr, NomadNamespace) | ||
|
||
if unsetOut != expectedOutput { | ||
t.Fatalf("\nExpected: %s\nActual: %s", expectedOutput, unsetOut) | ||
} | ||
|
||
} | ||
|
||
// endregion |
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
stack "just_consul" { | ||
consul { | ||
address = "http://localhost:8500" | ||
namespace = "default" | ||
} | ||
} |
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,6 @@ | ||
stack "just_nomad" { | ||
nomad { | ||
address = "http://localhost:4646" | ||
namespace = "default" | ||
} | ||
} |
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,6 @@ | ||
stack "just_vault" { | ||
vault { | ||
address = "http://localhost:8200" | ||
namespace = "default" | ||
} | ||
} |
Oops, something went wrong.