Commit Graph

12 Commits

Author SHA1 Message Date
peter woodman
ff2f9661a2
stop using XDG_CACHE_HOME as home directory (#299)
* stop using XDG_CACHE_HOME as home directory

XDG_CACHE_HOME is not a substitute for $HOME, see [1].

[1]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

* fix bats testing setup/teardown

since cmdutil.Homedir() would treat $XDG_CACHE_HOME as $HOME, deleting
$XDG_CACHE_HOME would wipe out previous kubens state. now that we're not
doing that, we need to make a real synthetic $HOME and clear it out so
that $HOME/.kube/kubens doesn't persist between runs.
2021-05-28 16:09:32 -07:00
Ahmet Alp Balkan
5348d7aa7e
kubens add a short-circuit to bypass API call for tests
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
fc2e1c6b08
Fix bug about where cur ns was stored in yaml
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
68b842f39b
do not fail on non-existing kubeconfig files
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
1284b822a5
Fix bugs for test pass, update tests
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
rob salmond
3369d42e2d
add unset flag (#187)
* add unset flag

* test unsetting selected context

* update readme with new unset flag

* testdata notes

* set a current context

* cleanup

* omit fixture changes
2020-02-04 09:39:47 -08:00
Ahmet Alp Balkan
28e7c12f51
Introduce -c/--current options for kubectx/kubens (#171)
Per #127 the user community wants to have this feature, primarily as
-c and --current flags.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2019-08-30 11:49:49 -07:00
Kumbirai Tanekha
402cc2c4b9 add cli tests for kubens (#117)
* split bats test invocation by executable

* add more cli tests for kubens

* clean up kubens tests

* small cleanup to kubens tests
2019-01-03 10:06:13 -08:00
Philippe MARTIN
df557e4fa7 Add more cli tests for kubectx (#113) 2019-01-02 09:47:01 -08:00
Philippe MARTIN
acbf324464 test: Add more kubectx tests (#111) 2018-12-25 11:38:45 -08:00
Ahmet Alp Balkan
845f3b690b
test: enable travis-ci with bats (#108)
- add .travis.yml.
- move bats fixtures to .bats extension, since it allows detection of test
files automatically by file extension.
- use BATS_TEST_DIRNAME variable to compute location of COMMAND.
- IMPORTANT: use `echo "$output">&2` before final check so that we can debug
  the test cases by their output

Ref #2.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-12-22 13:22:08 -08:00
Philippe MARTIN
2b5bf4e429 Add simple tests for kubectx/kubens -h/--help (#105) 2018-12-22 13:02:20 -08:00