Skip to content

test(locale): improve test using locale en_US.UTF-8 #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions test/integration/default/controls/command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(%r{db2.*remoteUser.*UTF8.*en_US.UTF-8.*en_US.UTF-8.*my_space}) }
end
end
6 changes: 0 additions & 6 deletions test/integration/default/controls/services_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -25,4 +20,3 @@
it { should be_listening }
end
end
end
34 changes: 17 additions & 17 deletions test/salt/pillar/postgres.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down