-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: use kubeconfig fixture to get config for clusterinfo
- Loading branch information
1 parent
4f6bf26
commit f3a6666
Showing
5 changed files
with
45 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
https://github.com/vapor-ware/kubetest/issues/156 | ||
|
||
### Summary | ||
|
||
This is a baseline (bl) test case for issue #156. It verifies that the `clusterinfo` fixture | ||
will use the value specified by the `--kube-config` command line arg when specified. See | ||
[regression/156](../156) for more details. | ||
|
||
#### Expectations | ||
|
||
When run with a command-line defined kubeconfig, a test using the `clusterinfo` fixture should | ||
resolve the cluster info using the kubeconfig specified by the command line flag. |
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,5 @@ | ||
|
||
|
||
def test_156_baseline(kube, clusterinfo): | ||
kube.wait_for_ready_nodes(1, timeout=3 * 60) | ||
print(f'cluster info: {vars(clusterinfo)}') |
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,13 @@ | ||
|
||
https://github.com/vapor-ware/kubetest/issues/156 | ||
|
||
### Summary | ||
|
||
When the kubeconfig is provided by a pytest fixture and not via the `--kube-config` command line | ||
flag, the `clusterinfo` fixture will fail, since it uses the kubeconfig value specified by the | ||
command line flag and does not account for custom fixture. | ||
|
||
#### Expectations | ||
|
||
When run with a fixture-defined kubeconfig, a test using the `clusterinfo` fixture should | ||
resolve the cluster info using the kubeconfig provided by the custom fixture. |
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,12 @@ | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def kubeconfig(request): | ||
return '~/.kube/config' | ||
|
||
|
||
def test_156(kube, clusterinfo): | ||
kube.wait_for_ready_nodes(1, timeout=3 * 60) | ||
print(f'cluster info: {vars(clusterinfo)}') |