From 77960641dd02fd676a1333c632c8dc0bb2a9e216 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 31 May 2019 00:28:42 +0100 Subject: [PATCH 1/4] test(locale): improve test using locale `en_US.UTF-8` --- pillar.example | 2 +- .../default/controls/command_spec.rb | 3 +- test/salt/pillar/postgres.sls | 34 +++++++++---------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/pillar.example b/pillar.example index 108c38a5..aa68a03a 100644 --- a/pillar.example +++ b/pillar.example @@ -36,7 +36,7 @@ postgres: # The default `encoding` is derived from the `locale` so not recommended # to provide a value for it unless necessary cluster: - locale: en_GB.UTF-8 + locale: en_US.UTF-8 # encoding: UTF8 #'Alternatives system' priority incremental. 0 disables feature. diff --git a/test/integration/default/controls/command_spec.rb b/test/integration/default/controls/command_spec.rb index 3ab70352..3c3a3b6d 100644 --- a/test/integration/default/controls/command_spec.rb +++ b/test/integration/default/controls/command_spec.rb @@ -9,7 +9,6 @@ # Can't use `%Q` here due to the `\` describe command(%q{su - postgres -c 'psql -p} + pg_port + %q{ -qtc "\l+ db2"'}) do - its(:stdout) { should match(/.*db2.*my_space/) } - # its(:stdout) { should match(/db2.*remoteUser.*UTF8.*en_US\.UTF-8.*en_US\.UTF-8.*my_space/) } + its(:stdout) { should match(/db2.*remoteUser.*UTF8.*en_US\.UTF-8.*en_US\.UTF-8.*my_space/) } end end diff --git a/test/salt/pillar/postgres.sls b/test/salt/pillar/postgres.sls index 2c55bfb0..7e234f88 100644 --- a/test/salt/pillar/postgres.sls +++ b/test/salt/pillar/postgres.sls @@ -42,13 +42,13 @@ postgres: # - postgresql-contrib # - postgresql-plpython - # # CLUSTER - # # The default `encoding` is derived from the `locale` so not recommended - # # to provide a value for it unless necessary - # cluster: - # locale: en_GB.UTF-8 - # # encoding: UTF8 - # + # CLUSTER + # The default `encoding` is derived from the `locale` so not recommended + # to provide a value for it unless necessary + cluster: + locale: en_US.UTF-8 + # encoding: UTF8 + # #'Alternatives system' priority incremental. 0 disables feature. # linux: # altpriority: 30 @@ -166,20 +166,20 @@ postgres: # databases to be created databases: db1: - owner: 'localUser' - # template: 'template0' - # lc_ctype: 'en_US.UTF-8' - # lc_collate: 'en_US.UTF-8' + owner: localUser + template: template0 + lc_ctype: en_US.UTF-8 + lc_collate: en_US.UTF-8 db2: - owner: 'remoteUser' - # template: 'template0' - # lc_ctype: 'en_US.UTF-8' - # lc_collate: 'en_US.UTF-8' - tablespace: 'my_space' + owner: remoteUser + template: template0 + lc_ctype: en_US.UTF-8 + lc_collate: en_US.UTF-8 + tablespace: my_space # set custom schema schemas: public: - owner: 'localUser' + owner: localUser # enable per-db extension {%- if grains.os_family == 'Debian' and grains.osfinger != 'Debian-8' %} extensions: From a054cea962a424a3544d2357c11585b60bc26b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20B=C3=A9rtoli?= Date: Tue, 14 May 2019 18:49:59 +0100 Subject: [PATCH 2/4] test(command_spec): use cleaner `match` string using `%r` --- test/integration/default/controls/command_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/default/controls/command_spec.rb b/test/integration/default/controls/command_spec.rb index 3c3a3b6d..26d7917e 100644 --- a/test/integration/default/controls/command_spec.rb +++ b/test/integration/default/controls/command_spec.rb @@ -9,6 +9,6 @@ # Can't use `%Q` here due to the `\` describe command(%q{su - postgres -c 'psql -p} + pg_port + %q{ -qtc "\l+ db2"'}) do - its(:stdout) { should match(/db2.*remoteUser.*UTF8.*en_US\.UTF-8.*en_US\.UTF-8.*my_space/) } + its(:stdout) { should match(%r{db2.*remoteUser.*UTF8.*en_US.UTF-8.*en_US.UTF-8.*my_space}) } end end From 81165fc405c9f4f1ffa74b2abf6bd0f8fb7bcd54 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 31 May 2019 02:15:57 +0100 Subject: [PATCH 3/4] test(`services_spec`): remove temporary `suse` conditional * `train` gem has been fixed upstream - https://github.com/inspec/train/pull/451 - https://rubygems.org/gems/train/versions/2.1.7 --- test/integration/default/controls/services_spec.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/integration/default/controls/services_spec.rb b/test/integration/default/controls/services_spec.rb index d70329d0..96e5f938 100644 --- a/test/integration/default/controls/services_spec.rb +++ b/test/integration/default/controls/services_spec.rb @@ -7,11 +7,6 @@ pg_port = 5433 end -# Temporary `if` due to `opensuse-leap-15` bug re: `service` -if os[:name] == 'suse' - puts "[Skip `service`-based tests due to `opensuse-leap-15` detection bug (see https://github.com/inspec/train/issues/377)]" - puts "[Skip `service`-based tests due to `opensuse-leap-15` bug]" -else control 'Postgres service' do impact 0.5 title 'should be running and enabled' @@ -25,4 +20,3 @@ it { should be_listening } end end -end From 2ff919f1bf8d0b377325d8f419d2568fa09a4442 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 31 May 2019 02:19:35 +0100 Subject: [PATCH 4/4] ci(travis): reduce matrix down to 6 instances * Ref: https://github.com/saltstack-formulas/template-formula/pull/121 --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b4d585c..5aa3a9b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,21 +22,21 @@ env: # TODO: Re-enable this once the `systemd` service can be restarted reliably # - INSTANCE: default-ubuntu-1804-2019-2-py3 - INSTANCE: default-centos-7-2019-2-py3 - - INSTANCE: default-fedora-29-2019-2-py3 + # - INSTANCE: default-fedora-29-2019-2-py3 - INSTANCE: default-opensuse-leap-15-2019-2-py3 - - INSTANCE: default-debian-9-2018-3-py2 + # - INSTANCE: default-debian-9-2018-3-py2 - INSTANCE: default-ubuntu-1604-2018-3-py2 - - INSTANCE: default-centos-7-2018-3-py2 + # - INSTANCE: default-centos-7-2018-3-py2 - INSTANCE: default-fedora-29-2018-3-py2 # TODO: Use this when fixed instead of `opensuse-423` # NOTE: Having to temporarily disable `opensuse-423` due to slow mirror # - INSTANCE: default-opensuse-leap-15-2018-3-py2 # - INSTANCE: default-opensuse-423-2018-3-py2 - - INSTANCE: default-debian-8-2017-7-py2 - - INSTANCE: default-ubuntu-1604-2017-7-py2 + # - INSTANCE: default-debian-8-2017-7-py2 + # - INSTANCE: default-ubuntu-1604-2017-7-py2 - INSTANCE: default-centos-6-2017-7-py2 - - INSTANCE: default-fedora-28-2017-7-py2 - - INSTANCE: default-opensuse-leap-42-2017-7-py2 + # - INSTANCE: default-fedora-28-2017-7-py2 + # - INSTANCE: default-opensuse-leap-42-2017-7-py2 script: - bundle exec kitchen verify ${INSTANCE}