diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-07-31 13:29:00 +0200 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-07-31 16:32:26 +0200 |
commit | 6df5bd8b848322aa3e2ce5fd8cad0e2a20b06000 (patch) | |
tree | 9cce83ce235bf1982acd8bd9db6cdc8e8ab4ff48 /spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb | |
parent | ce83e5635d1903cfadf4e2d9a7088b505f6c28ff (diff) | |
download | gitlab-ce-6df5bd8b848322aa3e2ce5fd8cad0e2a20b06000.tar.gz |
Context handling and tests cleanup + simple test kube_namespace context test
Diffstat (limited to 'spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb')
-rw-r--r-- | spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb b/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb index e42e034f4fb..c7169717fc1 100644 --- a/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb @@ -1,19 +1,14 @@ require 'spec_helper' describe Gitlab::Prometheus::Queries::AdditionalMetricsDeploymentQuery do - include Prometheus::MetricBuilders - - let(:client) { double('prometheus_client') } - let(:environment) { create(:environment, slug: 'environment-slug') } - let(:deployment) { create(:deployment, environment: environment) } - - subject(:query_result) { described_class.new(client).query(deployment.id) } - around do |example| Timecop.freeze(Time.local(2008, 9, 1, 12, 0, 0)) { example.run } end include_examples 'additional metrics query' do + let(:deployment) { create(:deployment, environment: environment) } + let(:query_params) { [deployment.id] } + it 'queries using specific time' do expect(client).to receive(:query_range).with(anything, start: (deployment.created_at - 30.minutes).to_f, |