<commit_before>#!/bin/bash
source "$(dirname "${BASH_SOURCE}")/../../hack/lib/init.sh"
trap os::test::junit::reconcile_output EXIT

os::test::junit::declare_suite_start "cmd/get"
# This test validates the help commands and output text
os::cmd::expect_success "oc whoami"
os::cmd::expect_success "oc project default/127-0-0-1:28443/system:admin"
# verify some default commands
os::cmd::expect_failure_and_text "_output/oshinko-cli get" "The token is not provided."
os::cmd::expect_success "_output/oshinko-cli version"
os::cmd::expect_success "oc login -u oshinko -p password"
os::cmd::expect_success "oc new-project oshinko"
os::cmd::expect_success "oc get pods"
os::cmd::expect_success "oc whoami -t"
os::cmd::expect_success "oc whoami"

#create
os::cmd::expect_success "_output/oshinko-cli create abc --workers=1 --token=`oc whoami -t`"
VERBOSE=true os::cmd::expect_success "_output/oshinko-cli get abc --token=`oc whoami -t` -o json"

#scale
os::cmd::expect_success_and_text "_output/oshinko-cli scale abc --token=`oc whoami -t`" "neither masters nor workers specified, cluster \"abc\" not scaled"
os::cmd::expect_failure_and_text "_output/oshinko-cli scale abc --masters=2 --token=`oc whoami -t`" "cluster configuration must have a master count between 0 and 1"
os::cmd::expect_success "_output/oshinko-cli scale abc --workers=0 --masters=0 --token=`oc whoami -t`"
os::cmd::expect_success "_output/oshinko-cli scale abc --workers=2 --token=`oc whoami -t`"
os::cmd::try_until_text "_output/oshinko-cli get abc --token=`oc whoami -t` -o json" '"workerCount": 0' 2

#delete
os::cmd::expect_success "_output/oshinko-cli delete abc --token=`oc whoami -t`"
os::cmd::expect_failure_and_text "_output/oshinko-cli get abc --token=`oc whoami -t` -o json" "no such cluster 'abc'"

#flags
os::cmd::expect_failure_and_text "_output/oshinko-cli get --token=`oc whoami -t` --verbose --namespace=bob" "Using project \"bob\""
os::cmd::expect_success_and_text "_output/oshinko-cli get --token=`oc whoami -t` --verbose" "Using project \"oshinko\""

os::cmd::expect_success "oc project default/127-0-0-1:28443/system:admin"
os::cmd::expect_success "oc delete ns oshinko"
os::test::junit::declare_suite_end
<commit_msg>Fix master scale test expected text<commit_after>#!/bin/bash
source "$(dirname "${BASH_SOURCE}")/../../hack/lib/init.sh"
trap os::test::junit::reconcile_output EXIT

os::test::junit::declare_suite_start "cmd/get"
# This test validates the help commands and output text
os::cmd::expect_success "oc whoami"
os::cmd::expect_success "oc project default/127-0-0-1:28443/system:admin"
# verify some default commands
os::cmd::expect_failure_and_text "_output/oshinko-cli get" "The token is not provided."
os::cmd::expect_success "_output/oshinko-cli version"
os::cmd::expect_success "oc login -u oshinko -p password"
os::cmd::expect_success "oc new-project oshinko"
os::cmd::expect_success "oc get pods"
os::cmd::expect_success "oc whoami -t"
os::cmd::expect_success "oc whoami"

#create
os::cmd::expect_success "_output/oshinko-cli create abc --workers=1 --token=`oc whoami -t`"
VERBOSE=true os::cmd::expect_success "_output/oshinko-cli get abc --token=`oc whoami -t` -o json"

#scale
os::cmd::expect_success_and_text "_output/oshinko-cli scale abc --token=`oc whoami -t`" "neither masters nor workers specified, cluster \"abc\" not scaled"
os::cmd::expect_failure_and_text "_output/oshinko-cli scale abc --masters=2 --token=`oc whoami -t`" "cluster configuration must have a master count of 0 or 1"
os::cmd::expect_success "_output/oshinko-cli scale abc --workers=0 --masters=0 --token=`oc whoami -t`"
os::cmd::expect_success "_output/oshinko-cli scale abc --workers=2 --token=`oc whoami -t`"
os::cmd::try_until_text "_output/oshinko-cli get abc --token=`oc whoami -t` -o json" '"workerCount": 0' 2

#delete
os::cmd::expect_success "_output/oshinko-cli delete abc --token=`oc whoami -t`"
os::cmd::expect_failure_and_text "_output/oshinko-cli get abc --token=`oc whoami -t` -o json" "no such cluster 'abc'"

#flags
os::cmd::expect_failure_and_text "_output/oshinko-cli get --token=`oc whoami -t` --verbose --namespace=bob" "Using project \"bob\""
os::cmd::expect_success_and_text "_output/oshinko-cli get --token=`oc whoami -t` --verbose" "Using project \"oshinko\""

os::cmd::expect_success "oc project default/127-0-0-1:28443/system:admin"
os::cmd::expect_success "oc delete ns oshinko"
os::test::junit::declare_suite_end

{'fraction_non_alphanumeric': 0.16063348416289594, 'fraction_numerical': 0.014027149321266969, 'mean_word_length': 5.864906832298137, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3167718', 'n_tokens_mistral': 1592, 'n_tokens_neox': 1541, 'n_words': 403}