Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wr0ngway committed Sep 22, 2021
1 parent 8cca242 commit 3246b96
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 106 deletions.
1 change: 1 addition & 0 deletions lib/kubetruth/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def convert_types(hash)
key_selector: '',
environment: 'default',
skip: false,
log_level: nil,
included_projects: [],
context: {},
resource_templates: []
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion spec/kubetruth/ctapi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Kubetruth
# Spin up a local dev server and create a user with an api key to use
# here, or use cloudtruth actual
key = ENV['CLOUDTRUTH_API_KEY']
url = ENV['CLOUDTRUTH_API_URL'] || "https://localhost:8000"
url = ENV['CLOUDTRUTH_API_URL'] || "https://api.cloudtruth.io" # "https://localhost:8000"
instance = ::Kubetruth::CtApi.new(api_key: key, api_url: url)
instance.client.config.debugging = false # ssl debug logging is messy, so only turn this on as desired
instance.client.config.ssl_verify = false
Expand Down
5 changes: 1 addition & 4 deletions spec/kubetruth/etl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,7 @@ class ForceExit < Exception; end
describe "#apply" do

let(:collection) { ProjectCollection.new }
let(:root_spec_crd) {
default_root_spec = YAML.load_file(File.expand_path("../../helm/kubetruth/values.yaml", __dir__)).deep_symbolize_keys
default_root_spec[:projectMappings][:root]
}
let(:root_spec_crd) { default_root_spec }
let(:config) {
Kubetruth::Config.new([root_spec_crd])
}
Expand Down
2 changes: 1 addition & 1 deletion spec/kubetruth/kubeapi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def apiserver; "https://127.0.0.1"; end
expect(crds.keys.first).to eq(kubeapi.namespace)
expect(crds.values.first).to match(hash_including("#{helm_name}-root"))
expect(crds.values.first["#{helm_name}-root"][:name]).to eq("#{helm_name}-root")
expect(crds.values.first["#{helm_name}-root"].keys.sort).to eq(Kubetruth::Config::ProjectSpec.new.to_h.keys.sort)
expect(crds.values.first["#{helm_name}-root"].keys.sort).to eq((default_root_spec.keys << :name).sort)
end

it "can watch project mappings" do
Expand Down
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def fixture_dir
@fixture_dir ||= File.expand_path("../fixtures", __FILE__)
end

def default_root_spec
default_root_spec = YAML.load_file(File.expand_path("../helm/kubetruth/values.yaml", __dir__)).deep_symbolize_keys
default_root_spec[:projectMappings][:root]
end

def logger
::Logging.logger.root
end
Expand Down

0 comments on commit 3246b96

Please sign in to comment.