Skip to content

Commit

Permalink
Set release date and version; minor test fixes for 0.4.4 release (#1166)
Browse files Browse the repository at this point in the history
  • Loading branch information
przemyslavic authored Apr 16, 2020
1 parent 3e30f24 commit 99fd850
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG-0.4.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog 0.4

## [0.4.4] 2020-04-xx
## [0.4.4] 2020-04-16

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion core/src/epicli/cli/version.txt.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.3
0.4.4
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
require 'applications/auth-service/auth-service'


if !readDataYaml("configuration/applications")["specification"]["applications"].select {|i| i["name"] == 'rabbitmq' }.nil?
if !readDataYaml("configuration/applications")["specification"]["applications"].select {|i| i["name"] == 'rabbitmq' }.empty?
callRabbitMQDeploymentTests
end

if !readDataYaml("configuration/applications")["specification"]["applications"].select {|i| i["name"] == 'auth-service' }.nil?
if !readDataYaml("configuration/applications")["specification"]["applications"].select {|i| i["name"] == 'auth-service' }.empty?
callAuthServiceDeploymentTests
end
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
end
end

if count_inventory_roles("elasticsearch") > 0
if countInventoryHosts("elasticsearch") > 0
describe 'Checking the connection to the Elasticsearch host' do
let(:disable_sudo) { false }
describe command("curl -o /dev/null -s -w '%{http_code}' $(awk '/- Elasticsearch output -/,/- Logstash output -/' /etc/filebeat/filebeat.yml \
Expand All @@ -47,7 +47,7 @@
end
end

if count_inventory_roles("kibana") > 0
if countInventoryHosts("kibana") > 0
describe 'Checking the connection to the Kibana endpoint' do
let(:disable_sudo) { false }
describe command("curl -o /dev/null -s -w '%{http_code}' $(awk '/= Kibana =/,/= Elastic Cloud =/' /etc/filebeat/filebeat.yml \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
end
end

if count_inventory_roles("kafka") == 1
if countInventoryHosts("kafka") == 1
describe 'Checking if it is possible to collect any jvm metrics' do
describe command("curl -s #{jmx_exporter_host}:#{jmx_exporter_port_for_zookeeper} | grep -i ^jvm_memory") do
its(:exit_status) { should eq 0 }
end
end
elsif count_inventory_roles("kafka") > 1
elsif countInventoryHosts("kafka") > 1
describe 'Checking if it is possible to collect the metrics from ZooKeeper' do
describe command("curl -s #{jmx_exporter_host}:#{jmx_exporter_port_for_zookeeper} | grep -i ^zookeeper") do
its(:stdout) { should match /zookeeper/ }
Expand Down
4 changes: 2 additions & 2 deletions core/src/epicli/tests/serverspec-cli/spec/kafka/kafka_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
describe 'Checking if the number of Kafka brokers is the same as indicated in the inventory file' do
describe command("echo 'dump' | curl -s telnet://#{zookeeper_host}:#{zookeeper_client_port} | grep -c brokers") do
it "is expected to be equal" do
expect(subject.stdout.to_i).to eq count_inventory_roles("kafka")
expect(subject.stdout.to_i).to eq countInventoryHosts("kafka")
end
end
end

describe 'Checking the possibility of creating a topic, producing and consuming messages' do

kafka_brokers_count = count_inventory_roles("kafka")
kafka_brokers_count = countInventoryHosts("kafka")
timestamp = DateTime.now.to_time.to_i.to_s
topic_name = 'topic' + timestamp
partitions = kafka_brokers_count*3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
end
end

if count_inventory_roles("elasticsearch") > 0
if countInventoryHosts("elasticsearch") > 0
describe 'Checking the connection to the Elasticsearch host' do
let(:disable_sudo) { false }
describe command("curl -o /dev/null -s -w '%{http_code}' $(grep -oP '(?<=elasticsearch.url: \\\").*(?=\\\")' /etc/kibana/kibana.yml)") do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@
describe 'Checking if there are any pods that have status other than Running' do
describe command('kubectl get pods --all-namespaces --field-selector=status.phase!=Running') do
its(:stdout) { should match /^$/ }
its(:stderr) { should match /No resources found./ }
its(:stderr) { should match /No resources found/ }
end
end

describe 'Checking if the number of master nodes is the same as indicated in the inventory file' do
describe command('kubectl get nodes --selector=node-role.kubernetes.io/master --no-headers | wc -l | tr -d "\n"') do
it "is expected to be equal" do
expect(subject.stdout.to_i).to eq count_inventory_roles("kubernetes_master")
expect(subject.stdout.to_i).to eq countInventoryHosts("kubernetes_master")
end
end
end

describe 'Checking if the number of worker nodes is the same as indicated in the inventory file' do
describe command('kubectl get nodes --no-headers | grep -v master | wc -l | tr -d "\n"') do
it "is expected to be equal" do
expect(subject.stdout.to_i).to eq count_inventory_roles("kubernetes_node")
expect(subject.stdout.to_i).to eq countInventoryHosts("kubernetes_node")
end
end
end
Expand Down Expand Up @@ -174,3 +174,18 @@
end
end
end

if countInventoryHosts("kubernetes_node") == 0

describe 'Checking taints on Kubernetes master' do
describe command('kubectl get nodes -o jsonpath="{.items[*].spec.taints}"') do
its(:stdout) { should match /^$/ }
its(:exit_status) { should eq 0 }
end
describe command('kubectl describe nodes | grep -i taints') do
its(:stdout) { should match /<none>/ }
its(:exit_status) { should eq 0 }
end
end

end
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ def queryForDropping
end
end

# Running the 'systemctl is-active' command returns the result 'unknown'.
# https://bugzilla.redhat.com/show_bug.cgi?id=1073481
# Must first run the 'systemctl status' command to be able to view the service status withe the 'is-active' command.

describe 'Checking PostgreSQL service status' do
describe command("systemctl status postgresql > /dev/null") do
its(:exit_status) { should eq 0 }
end
end

describe 'Checking if PostgreSQL service is running' do
describe service('postgresql') do
it { should be_enabled }
Expand Down
2 changes: 1 addition & 1 deletion core/src/epicli/tests/serverspec-cli/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# Set PATH
# set :path, '/sbin:/usr/local/sbin:$PATH'

def count_inventory_roles(role)
def countInventoryHosts(role)
file = File.open(ENV['inventory'], "rb")
input = file.read
file.close
Expand Down

0 comments on commit 99fd850

Please sign in to comment.