-
Notifications
You must be signed in to change notification settings - Fork 108
Cmr 10636 jn #2280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cmr 10636 jn #2280
Changes from all commits
09d386f
87e6203
8918130
2019755
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,14 @@ | ||
| (ns cmr.elastic-utils.test.es-index | ||
| "Tests for the cmr.elastic-utils.search.es-index namespace" | ||
| (:require | ||
| (:require | ||
| [clojure.test :refer [deftest is testing]] | ||
| [cmr.elastic-utils.search.es-index :as es-index] | ||
| [cmr.common.services.search.query-model :as qm] | ||
| [cmr.elastic-utils.search.es-group-query-conditions :as gc])) | ||
| [cmr.elastic-utils.config :as config] | ||
| [cmr.elastic-utils.search.es-group-query-conditions :as gc] | ||
| [cmr.elastic-utils.search.es-index :as es-index])) | ||
|
|
||
| (def gran-cluster cmr.elastic-utils.config/gran-elastic-name) | ||
| (def non-gran-cluster config/non-gran-elastic-name) | ||
|
|
||
| (deftest test-query->execution-params | ||
| (let [query->execution-params #'es-index/query->execution-params | ||
|
|
@@ -27,3 +31,21 @@ | |
| execution-params (query->execution-params query)] | ||
| (is (not (= false | ||
| (:_source execution-params)))))))) | ||
|
|
||
| (deftest test-get-es-cluster-name-from-index-name | ||
| (testing "All excluded indices always return non-gran cluster regardless of other patterns" | ||
| (let [excluded #{"collection_search_alias" "1_collections_v2"}] | ||
| (doseq [excluded-index excluded] | ||
| (is (= non-gran-cluster | ||
| (es-index/get-es-cluster-name-from-index-name excluded-index)))))) | ||
|
|
||
| (testing "All indices starting with '1_c' (but not excluded) return gran cluster" | ||
| (let [test-indices ["1_c" "1_ca" "1_collections" "1_custom" "1_c123"]] | ||
| (doseq [index test-indices] | ||
| (is (= gran-cluster | ||
| (es-index/get-es-cluster-name-from-index-name index)))))) | ||
|
|
||
| (testing "Random/default indices should return non-gran cluster" | ||
| (let [random #{"some_index" "users" "metadata" ""}] | ||
| (doseq [index random] | ||
| (is (= non-gran-cluster (es-index/get-es-cluster-name-from-index-name index))))))) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you have a missing new line. Did you use vscode and the calva plugin?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, vscode and calva
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure to which newline you are referring
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the one at the end of the file, the (-). |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # file: cmr.fish | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait, there is another fish user on the project?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this file for?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, this is a command completions file for using the |
||
| # cmr (sub)command-completion for fish shell | ||
| # copy this file to ~/.config/fish/completions | ||
|
|
||
| set -l apps access-control bootstrap dev-system indexer ingest metadata-db search virtual-product | ||
| set -l libs acl-lib common-app-lib common-lib elastic-utils-lib es-spatial-plugin message-queue-lib oracle-lib orbits-lib redis-lib spatial-lib transmit-lib umm-lib umm-spec-lib vdd-spatial-viz | ||
| set -l apps_libs $apps $libs | ||
|
|
||
| # Level 1 | ||
| set -l top_commands build clean git install setup show start status stop test | ||
| set -l top_dashed -h -v --help --version | ||
|
|
||
| # Level 2 | ||
| set -l setup_level local db dev help profile | ||
| set -l build_level docker help uberdocker uberjar uberjars | ||
| set -l clean_level all es-data help $apps_libs | ||
| set -l install_level all docs help jars 'jars,docs' local orbits-gems oracle-libs | ||
| set -l show_level help log log-tail log-test log-tests port-process sqs-queues | ||
| set -l start_level all docker help local repl uberdocker uberjar $apps | ||
| set -l status_level docker help sqs-sns uberdocker uberjar | ||
| set -l stop_level all docker help local uberdocker uberjar $apps | ||
| set -l test_level all cicd dep-tree dep-trees help lint versions | ||
| set -l git_level branches help log-latest log-short log-graph tag | ||
|
|
||
| # Level 3 | ||
| set -l setup_db_level create-users do-migrations help | ||
| set -l star_docker_level all help $apps | ||
| set -l star_local_level spatial_plugin sqs-sns help | ||
| set -l uberdocker_level separate together | ||
|
|
||
| # Main completion function | ||
| complete -c cmr -f | ||
|
|
||
| # Level 1 completions | ||
| complete -c cmr -n __fish_use_subcommand -a "$top_commands" | ||
| complete -c cmr -n __fish_use_subcommand -a "$top_dashed" | ||
|
|
||
| # Level 2 completions | ||
| complete -c cmr -n '__fish_seen_subcommand_from build' -a "$build_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from clean' -a "$clean_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from git' -a "$git_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from help' -a "$top_commands" | ||
| complete -c cmr -n '__fish_seen_subcommand_from install' -a "$install_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from setup' -a "$setup_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from show' -a "$show_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from start' -a "$start_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from status' -a "$status_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from stop' -a "$stop_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from test' -a "$test_level" | ||
|
|
||
| # Level 3 completions | ||
| complete -c cmr -n '__fish_seen_subcommand_from setup; and __fish_seen_subcommand_from db' -a "$setup_db_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from test; and __fish_seen_subcommand_from dep-tree' -a "$apps_libs" | ||
| complete -c cmr -n '__fish_seen_subcommand_from start; and __fish_seen_subcommand_from docker' -a "$star_docker_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from stop; and __fish_seen_subcommand_from docker' -a "$star_docker_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from status; and __fish_seen_subcommand_from docker' -a "$star_docker_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from test; and __fish_seen_subcommand_from lint' -a "$apps_libs" | ||
| complete -c cmr -n '__fish_seen_subcommand_from start; and __fish_seen_subcommand_from local' -a "$star_local_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from stop; and __fish_seen_subcommand_from local' -a "$star_local_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from show; and __fish_seen_subcommand_from log' -a "$apps" | ||
| complete -c cmr -n '__fish_seen_subcommand_from show; and __fish_seen_subcommand_from log-tail' -a "$apps" | ||
| complete -c cmr -n '__fish_seen_subcommand_from show; and __fish_seen_subcommand_from log-test' -a "$apps" | ||
| complete -c cmr -n '__fish_seen_subcommand_from start; and __fish_seen_subcommand_from uberdocker' -a "$uberdocker_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from stop; and __fish_seen_subcommand_from uberdocker' -a "$uberdocker_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from status; and __fish_seen_subcommand_from uberdocker' -a "$uberdocker_level" | ||
| complete -c cmr -n '__fish_seen_subcommand_from start; and __fish_seen_subcommand_from uberjar' -a "$apps" | ||
| complete -c cmr -n '__fish_seen_subcommand_from stop; and __fish_seen_subcommand_from uberjar' -a "$apps" | ||
| complete -c cmr -n '__fish_seen_subcommand_from build; and __fish_seen_subcommand_from uberjar' -a "$apps" | ||
| complete -c cmr -n '__fish_seen_subcommand_from test; and __fish_seen_subcommand_from versions' -a "$apps_libs" | ||
Uh oh!
There was an error while loading. Please reload this page.