From 5b8d258a1fe2e2a987772ef9b5b69f8633dbd058 Mon Sep 17 00:00:00 2001 From: tsivakum Date: Mon, 25 Sep 2023 16:12:26 +0100 Subject: [PATCH] add tests for list machinepools command --- tests/ginkgo.report | 1784 +++++++++++++++++++++++++++++++ tests/list_machinepools_test.go | 189 ++++ 2 files changed, 1973 insertions(+) create mode 100644 tests/ginkgo.report create mode 100644 tests/list_machinepools_test.go diff --git a/tests/ginkgo.report b/tests/ginkgo.report new file mode 100644 index 00000000..437d29d0 --- /dev/null +++ b/tests/ginkgo.report @@ -0,0 +1,1784 @@ +[ + { + "SuitePath": "/home/anshu/ocm/ocm-cli/tests", + "SuiteDescription": "CLI", + "SuiteLabels": [], + "SuiteSucceeded": true, + "SuiteHasProgrammaticFocus": false, + "SpecialSuiteFailureReasons": null, + "PreRunStats": { + "TotalSpecs": 48, + "SpecsThatWillRun": 1 + }, + "StartTime": "2023-09-27T11:01:30.312001573+01:00", + "EndTime": "2023-09-27T11:01:30.394420793+01:00", + "RunTime": 82419219, + "SuiteConfig": { + "RandomSeed": 1695808887, + "RandomizeAllSpecs": false, + "FocusStrings": [ + "List machine pools Able to list information on machine pool named as default" + ], + "SkipStrings": null, + "FocusFiles": null, + "SkipFiles": null, + "LabelFilter": "", + "FailOnPending": false, + "FailFast": false, + "FlakeAttempts": 0, + "DryRun": false, + "PollProgressAfter": 0, + "PollProgressInterval": 0, + "Timeout": 3598879421827, + "EmitSpecProgress": false, + "OutputInterceptorMode": "", + "SourceRoots": null, + "GracePeriod": 30000000000, + "ParallelProcess": 1, + "ParallelTotal": 1, + "ParallelHost": "" + }, + "SpecReports": [ + { + "ContainerHierarchyTexts": null, + "ContainerHierarchyLocations": null, + "ContainerHierarchyLabels": null, + "LeafNodeType": "BeforeSuite", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/main_test.go", + "LineNumber": 44 + }, + "LeafNodeLabels": null, + "LeafNodeText": "", + "State": "passed", + "StartTime": "2023-09-27T11:01:30.312039275+01:00", + "EndTime": "2023-09-27T11:01:30.312075702+01:00", + "RunTime": 36423, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0, + "SpecEvents": [ + { + "SpecEventType": "Node", + "CodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/main_test.go", + "LineNumber": 44 + }, + "TimelineLocation": { + "Order": 1, + "Time": "2023-09-27T11:01:30.312040598+01:00" + }, + "Message": "TOP-LEVEL", + "NodeType": "BeforeSuite" + }, + { + "SpecEventType": "Node (End)", + "CodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/main_test.go", + "LineNumber": 44 + }, + "TimelineLocation": { + "Order": 3, + "Time": "2023-09-27T11:01:30.312074685+01:00" + }, + "Message": "TOP-LEVEL", + "Duration": 34087, + "NodeType": "BeforeSuite" + } + ] + }, + { + "ContainerHierarchyTexts": [ + "Token", + "when Logged in" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/token_test.go", + "LineNumber": 29 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/token_test.go", + "LineNumber": 37 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/token_test.go", + "LineNumber": 61 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Displays current access token", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312135202+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Token", + "when Logged in" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/token_test.go", + "LineNumber": 29 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/token_test.go", + "LineNumber": 37 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/token_test.go", + "LineNumber": 68 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Displays current refresh token", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312144302+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Token", + "when Not logged in" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/token_test.go", + "LineNumber": 29 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/token_test.go", + "LineNumber": 76 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/token_test.go", + "LineNumber": 81 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312149245+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Plugin list" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/plugin_list_test.go", + "LineNumber": 30 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/plugin_list_test.go", + "LineNumber": 67 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Writes the list of plugins", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312153306+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Plugin list" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/plugin_list_test.go", + "LineNumber": 30 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/plugin_list_test.go", + "LineNumber": 90 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Honors the --columns option", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312158212+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Plugin list" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/plugin_list_test.go", + "LineNumber": 30 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/plugin_list_test.go", + "LineNumber": 116 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Honors the --nameonly option", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312161904+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Login", + "when Using offline token" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/login_test.go", + "LineNumber": 32 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/login_test.go", + "LineNumber": 49 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/login_test.go", + "LineNumber": 50 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Creates the configuration file", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312166118+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Login", + "when Using client credentials grant" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/login_test.go", + "LineNumber": 32 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/login_test.go", + "LineNumber": 89 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/login_test.go", + "LineNumber": 90 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Creates the configuration file", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.31217039+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Login", + "when Using password grant" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/login_test.go", + "LineNumber": 32 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/login_test.go", + "LineNumber": 135 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/login_test.go", + "LineNumber": 136 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Creates the configuration file", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312176148+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "List clusters", + "when Config file doesn't exist" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 39 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 40 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312180257+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "List clusters", + "when Config file doesn't contain valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 51 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312184709+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "List clusters", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 100 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Writes the clusters returned by the server", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312188938+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "List clusters", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_clusters_test.go", + "LineNumber": 226 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Doesn't trim `external_id` column", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312192791+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Describe clusters", + "when Describe with no cluster" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 40 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 41 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312196517+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Describe clusters", + "when Describe clusters" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 88 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Describe a non-exist cluster", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.31220073+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Describe clusters", + "when Describe clusters" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 124 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Describe an exist cluster", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312204854+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Describe clusters", + "when Describe clusters" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/describe_cluster_test.go", + "LineNumber": 322 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Describe a cluster with multiple matching subscriptions", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312212702+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Version" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/version_test.go", + "LineNumber": 28 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/version_test.go", + "LineNumber": 29 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Prints the version", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312216716+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Logout" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 29 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 36 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Doesn't remove configuration file", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312220517+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Logout" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 29 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 45 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Removes tokens from configuration file", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312224263+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Logout" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 29 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 66 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Removes client credentials from configuration file", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312227873+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Logout" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 29 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 78 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Removes URLs from configuration file", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312231288+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Logout" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 29 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 90 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Removes scopes from configuration file", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312235066+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Logout" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 29 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 104 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Removes insecure flag from configuration file", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312240792+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Logout" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 29 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/logout_test.go", + "LineNumber": 115 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Doesn't remove settings not related to authentication", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312244597+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Account orgs", + "when Config file doesn't exist" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/account_orgs_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/account_orgs_test.go", + "LineNumber": 39 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/account_orgs_test.go", + "LineNumber": 40 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312248863+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Account orgs", + "when Config file doesn't contain valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/account_orgs_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/account_orgs_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/account_orgs_test.go", + "LineNumber": 51 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312252711+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Account orgs", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/account_orgs_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/account_orgs_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/account_orgs_test.go", + "LineNumber": 100 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Writes the organizations returned by the server", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312256389+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "List machine pools" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 31 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 95 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Able to list machine pools information in a cluster with no duplicates", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.312262056+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "List machine pools" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 31 + } + ], + "ContainerHierarchyLabels": [ + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 149 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Able to list information on machine pool named as default", + "State": "passed", + "StartTime": "2023-09-27T11:01:30.312266201+01:00", + "EndTime": "2023-09-27T11:01:30.39429867+01:00", + "RunTime": 82032475, + "ParallelProcess": 1, + "NumAttempts": 1, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0, + "CapturedGinkgoWriterOutput": "GHTTP Received Request: POST - /\nGHTTP Received Request: GET - /api/accounts_mgmt/v1/subscriptions?search=%28display_name+%3D+%27my-cluster%27+or+cluster_id+%3D+%27my-cluster%27+or+external_cluster_id+%3D+%27my-cluster%27%29\u0026size=1\nGHTTP Received Request: GET - /api/clusters_mgmt/v1/clusters?search=id+%3D+%27my-cluster%27+or+name+%3D+%27my-cluster%27+or+external_id+%3D+%27my-cluster%27\u0026size=1\nGHTTP Received Request: GET - /api/clusters_mgmt/v1/clusters/my-cluster/machine_pools?page=1\u0026size=-1\n", + "SpecEvents": [ + { + "SpecEventType": "Node", + "CodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 59 + }, + "TimelineLocation": { + "Order": 4, + "Time": "2023-09-27T11:01:30.312280287+01:00" + }, + "Message": "List machine pools", + "NodeType": "BeforeAll" + }, + { + "SpecEventType": "Node (End)", + "CodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 59 + }, + "TimelineLocation": { + "Offset": 33, + "Order": 6, + "Time": "2023-09-27T11:01:30.359561301+01:00" + }, + "Message": "List machine pools", + "Duration": 47281014, + "NodeType": "BeforeAll" + }, + { + "SpecEventType": "Node", + "CodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 149 + }, + "TimelineLocation": { + "Offset": 33, + "Order": 7, + "Time": "2023-09-27T11:01:30.359570702+01:00" + }, + "Message": "Able to list information on machine pool named as default", + "NodeType": "It" + }, + { + "SpecEventType": "Node (End)", + "CodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 149 + }, + "TimelineLocation": { + "Offset": 497, + "Order": 9, + "Time": "2023-09-27T11:01:30.394242269+01:00" + }, + "Message": "Able to list information on machine pool named as default", + "Duration": 34671567, + "NodeType": "It" + }, + { + "SpecEventType": "Node", + "CodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 89 + }, + "TimelineLocation": { + "Offset": 497, + "Order": 10, + "Time": "2023-09-27T11:01:30.394248844+01:00" + }, + "Message": "List machine pools", + "NodeType": "AfterAll" + }, + { + "SpecEventType": "Node (End)", + "CodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_machinepools_test.go", + "LineNumber": 89 + }, + "TimelineLocation": { + "Offset": 497, + "Order": 12, + "Time": "2023-09-27T11:01:30.394296566+01:00" + }, + "Message": "List machine pools", + "Duration": 47722, + "NodeType": "AfterAll" + } + ] + }, + { + "ContainerHierarchyTexts": [ + "Post", + "when Not logged in" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 39 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 40 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394324478+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Post", + "when Logged in" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 88 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Sends the standard input to the server", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394332378+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Post", + "when Logged in" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 107 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Honours the --parameter flag", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394337129+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Post", + "when Logged in" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 129 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Honours the -p flag as alias to --parameter", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394342092+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Post", + "when Logged in" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/post_test.go", + "LineNumber": 151 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Honours the --header flag", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394346341+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "List orgs", + "when Config file doesn't exist" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_orgs_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_orgs_test.go", + "LineNumber": 39 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_orgs_test.go", + "LineNumber": 40 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394350696+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "List orgs", + "when Config file doesn't contain valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_orgs_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_orgs_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_orgs_test.go", + "LineNumber": 51 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394355132+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "List orgs", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_orgs_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_orgs_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/list_orgs_test.go", + "LineNumber": 100 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Writes the organizations returned by the server", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394368375+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Get", + "when Config file doesn't exist" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 39 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 40 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394372883+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Get", + "when Config file doesn't contain valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 50 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 51 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Fails", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394377163+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Get", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 100 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Writes the JSON returned by the server", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394381045+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Get", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 119 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Honours the --parameter flag", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394385713+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Get", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 141 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Honours the -p flag as alias to --parameter", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394390195+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Get", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 163 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Honours the --header flag", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394394341+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Get", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 185 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Indents by default", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394403545+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Get", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 215 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Honours the --single flag", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394408034+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Get", + "when Config file contains valid credentials" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 62 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/get_test.go", + "LineNumber": 243 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Preserves long integers", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394412062+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Whoami", + "when Offline user session not found" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/whoami_test.go", + "LineNumber": 31 + }, + { + "FileName": "/home/anshu/ocm/ocm-cli/tests/whoami_test.go", + "LineNumber": 39 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/home/anshu/ocm/ocm-cli/tests/whoami_test.go", + "LineNumber": 66 + }, + "LeafNodeLabels": [], + "LeafNodeText": "Writes user friendly message", + "State": "skipped", + "StartTime": "2023-09-27T11:01:30.394416177+01:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + } + ] + } +] diff --git a/tests/list_machinepools_test.go b/tests/list_machinepools_test.go new file mode 100644 index 00000000..103e3dfe --- /dev/null +++ b/tests/list_machinepools_test.go @@ -0,0 +1,189 @@ +/* +Copyright (c) 2021 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package tests + +import ( + "context" + "net/http" + "time" + + . "github.com/onsi/ginkgo/v2" // nolint + . "github.com/onsi/gomega" // nolint + . "github.com/onsi/gomega/ghttp" // nolint + + . "github.com/openshift-online/ocm-sdk-go/testing" // nolint +) + +var _ = Describe("List machine pools", Ordered, func() { + var ctx context.Context + + var ssoServer *Server + var apiServer *Server + var config string + + var subscriptionInfo string = `{ + "items": [ + { + "kind":"Subscription", + "cluster_id":"my-cluster", + "id":"subsID" + }] + }` + + var clustersInfo string = `{ + "kind": "ClusterList", + "total": 1, + "items": [ + { + "kind":"Cluster", + "id":"my-cluster", + "subscription": {"id":"subsID"}, + "state":"ready" + }] + }` + + BeforeAll(func() { + // Create a context: + ctx = context.Background() + + // Create the servers: + ssoServer = MakeTCPServer() + apiServer = MakeTCPServer() + + // Create the token: + accessToken := MakeTokenString("Bearer", 15*time.Minute) + + // Prepare the server: + ssoServer.AppendHandlers( + RespondWithAccessToken(accessToken), + ) + + // Login: + result := NewCommand(). + Args( + "login", + "--client-id", "my-client", + "--client-secret", "my-secret", + "--token-url", ssoServer.URL(), + "--url", apiServer.URL(), + ). + Run(ctx) + Expect(result.ExitCode()).To(BeZero()) + config = result.ConfigString() + }) + + AfterAll(func() { + // Close the servers: + ssoServer.Close() + apiServer.Close() + }) + + It("Able to list machine pools information in a cluster with no duplicates", func() { + + apiServer.AppendHandlers( + RespondWithJSON(http.StatusOK, subscriptionInfo), + RespondWithJSON(http.StatusOK, clustersInfo), + RespondWithJSON(http.StatusOK, `{ + "kind": "MachinePoolList", + "total": 2, + "items": [ + { + "kind": "MachinePool", + "id": "worker", + "replicas": 4, + "instance_type": "m5.xlarge", + "availability_zones": [ + "us-west-2a" + ] + }, + { + "kind": "MachinePool", + "id": "worker1", + "replicas": 2, + "instance_type": "m5.2xlarge", + "availability_zones": [ + "us-west-2a" + ] + } + ] + }`), + ) + + // Run the command: + result := NewCommand(). + ConfigString(config). + Args( + "list", "machinepools", + "--cluster", "my-cluster", + ).Run(ctx) + + Expect(result.ExitCode()).To(BeZero()) + lines := result.OutLines() + // The heading and 2 machinepool record information + Expect(lines).To(HaveLen(3)) + Expect(lines[0]).To(MatchRegexp( + `^ID\s+AUTOSCALING\s+REPLICAS\s+INSTANCE TYPE\s+LABELS\s+TAINTS\s+AVAILABILITY ZONES$`, + )) + Expect(lines[1]).To(MatchRegexp( + `^worker\s+No\s+4\s+m5.xlarge\s+us-west-2a$`, + )) + Expect(lines[2]).To(MatchRegexp( + `^worker1\s+No\s+2\s+m5.2xlarge\s+us-west-2a$`, + )) + }) + + It("Able to list information on machine pool named as default", func() { + apiServer.AppendHandlers( + RespondWithJSON(http.StatusOK, subscriptionInfo), + RespondWithJSON(http.StatusOK, clustersInfo), + RespondWithJSON(http.StatusOK, `{ + "kind": "MachinePoolList", + "total": 1, + "items": [ + { + "kind": "MachinePool", + "id": "default", + "replicas": 2, + "instance_type": "m5.xlarge", + "availability_zones": [ + "us-west-2a" + ] + } + ] + }`), + ) + + // Run the command: + result := NewCommand(). + ConfigString(config). + Args( + "list", "machinepools", + "--cluster", "my-cluster", + ).Run(ctx) + + Expect(result.ExitCode()).To(BeZero()) + lines := result.OutLines() + // The heading and 1 machinepool record information + Expect(lines).To(HaveLen(2)) + Expect(lines[0]).To(MatchRegexp( + `^ID\s+AUTOSCALING\s+REPLICAS\s+INSTANCE TYPE\s+LABELS\s+TAINTS\s+AVAILABILITY ZONES$`, + )) + Expect(lines[1]).To(MatchRegexp( + `^default\s+No\s+2\s+m5.xlarge\s+us-west-2a$`, + )) + }) +})