From 90ad55cc2ec5e8291374d4e4c645c9f5630f7d3e Mon Sep 17 00:00:00 2001 From: Christoph Maser Date: Sun, 29 Dec 2024 17:11:34 +0100 Subject: [PATCH] fix: tests for archlinux archlinux ships prometheus >= 3.0.0 this is a quick hack to fix the tests more work is needed to make the module compatible with prometheus >= 3.0.0 --- spec/acceptance/prometheus_server_spec.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/spec/acceptance/prometheus_server_spec.rb b/spec/acceptance/prometheus_server_spec.rb index 9f0168f04..88b07c6b2 100644 --- a/spec/acceptance/prometheus_server_spec.rb +++ b/spec/acceptance/prometheus_server_spec.rb @@ -45,10 +45,20 @@ end end - it 'can access static files' do - shell('curl -s http://127.0.0.1:9090/graph') do |r| - expect(r.stdout).to match(%r{doctype html}) - expect(r.exit_code).to eq(0) + if host_inventory['facter']['os']['name'] == 'Archlinux' + # Archlinux ships promethes >= 3.0.0 + it 'can access static files' do + shell('curl -s http://127.0.0.1:9090/query') do |r| + expect(r.stdout).to match(%r{doctype html}) + expect(r.exit_code).to eq(0) + end + end + else + it 'can access static files' do + shell('curl -s http://127.0.0.1:9090/graph') do |r| + expect(r.stdout).to match(%r{doctype html}) + expect(r.exit_code).to eq(0) + end end end