Skip to content

Commit cb4e405

Browse files
authored
Merge pull request #269 from myii/chore/test-locales
test(locale): improve test using locale `en_US.UTF-8`
2 parents cb8de93 + 2ff919f commit cb4e405

File tree

5 files changed

+26
-33
lines changed

5 files changed

+26
-33
lines changed

Diff for: .travis.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ env:
2222
# TODO: Re-enable this once the `systemd` service can be restarted reliably
2323
# - INSTANCE: default-ubuntu-1804-2019-2-py3
2424
- INSTANCE: default-centos-7-2019-2-py3
25-
- INSTANCE: default-fedora-29-2019-2-py3
25+
# - INSTANCE: default-fedora-29-2019-2-py3
2626
- INSTANCE: default-opensuse-leap-15-2019-2-py3
27-
- INSTANCE: default-debian-9-2018-3-py2
27+
# - INSTANCE: default-debian-9-2018-3-py2
2828
- INSTANCE: default-ubuntu-1604-2018-3-py2
29-
- INSTANCE: default-centos-7-2018-3-py2
29+
# - INSTANCE: default-centos-7-2018-3-py2
3030
- INSTANCE: default-fedora-29-2018-3-py2
3131
# TODO: Use this when fixed instead of `opensuse-423`
3232
# NOTE: Having to temporarily disable `opensuse-423` due to slow mirror
3333
# - INSTANCE: default-opensuse-leap-15-2018-3-py2
3434
# - INSTANCE: default-opensuse-423-2018-3-py2
35-
- INSTANCE: default-debian-8-2017-7-py2
36-
- INSTANCE: default-ubuntu-1604-2017-7-py2
35+
# - INSTANCE: default-debian-8-2017-7-py2
36+
# - INSTANCE: default-ubuntu-1604-2017-7-py2
3737
- INSTANCE: default-centos-6-2017-7-py2
38-
- INSTANCE: default-fedora-28-2017-7-py2
39-
- INSTANCE: default-opensuse-leap-42-2017-7-py2
38+
# - INSTANCE: default-fedora-28-2017-7-py2
39+
# - INSTANCE: default-opensuse-leap-42-2017-7-py2
4040

4141
script:
4242
- bundle exec kitchen verify ${INSTANCE}

Diff for: pillar.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ postgres:
3636
# The default `encoding` is derived from the `locale` so not recommended
3737
# to provide a value for it unless necessary
3838
cluster:
39-
locale: en_GB.UTF-8
39+
locale: en_US.UTF-8
4040
# encoding: UTF8
4141

4242
#'Alternatives system' priority incremental. 0 disables feature.

Diff for: test/integration/default/controls/command_spec.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
# Can't use `%Q` here due to the `\`
1111
describe command(%q{su - postgres -c 'psql -p} + pg_port + %q{ -qtc "\l+ db2"'}) do
12-
its(:stdout) { should match(/.*db2.*my_space/) }
13-
# its(:stdout) { should match(/db2.*remoteUser.*UTF8.*en_US\.UTF-8.*en_US\.UTF-8.*my_space/) }
12+
its(:stdout) { should match(%r{db2.*remoteUser.*UTF8.*en_US.UTF-8.*en_US.UTF-8.*my_space}) }
1413
end
1514
end

Diff for: test/integration/default/controls/services_spec.rb

-6
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
pg_port = 5433
88
end
99

10-
# Temporary `if` due to `opensuse-leap-15` bug re: `service`
11-
if os[:name] == 'suse'
12-
puts "[Skip `service`-based tests due to `opensuse-leap-15` detection bug (see https://github.com/inspec/train/issues/377)]"
13-
puts "[Skip `service`-based tests due to `opensuse-leap-15` bug]"
14-
else
1510
control 'Postgres service' do
1611
impact 0.5
1712
title 'should be running and enabled'
@@ -25,4 +20,3 @@
2520
it { should be_listening }
2621
end
2722
end
28-
end

Diff for: test/salt/pillar/postgres.sls

+17-17
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ postgres:
4242
# - postgresql-contrib
4343
# - postgresql-plpython
4444

45-
# # CLUSTER
46-
# # The default `encoding` is derived from the `locale` so not recommended
47-
# # to provide a value for it unless necessary
48-
# cluster:
49-
# locale: en_GB.UTF-8
50-
# # encoding: UTF8
51-
#
45+
# CLUSTER
46+
# The default `encoding` is derived from the `locale` so not recommended
47+
# to provide a value for it unless necessary
48+
cluster:
49+
locale: en_US.UTF-8
50+
# encoding: UTF8
51+
5252
# #'Alternatives system' priority incremental. 0 disables feature.
5353
# linux:
5454
# altpriority: 30
@@ -166,20 +166,20 @@ postgres:
166166
# databases to be created
167167
databases:
168168
db1:
169-
owner: 'localUser'
170-
# template: 'template0'
171-
# lc_ctype: 'en_US.UTF-8'
172-
# lc_collate: 'en_US.UTF-8'
169+
owner: localUser
170+
template: template0
171+
lc_ctype: en_US.UTF-8
172+
lc_collate: en_US.UTF-8
173173
db2:
174-
owner: 'remoteUser'
175-
# template: 'template0'
176-
# lc_ctype: 'en_US.UTF-8'
177-
# lc_collate: 'en_US.UTF-8'
178-
tablespace: 'my_space'
174+
owner: remoteUser
175+
template: template0
176+
lc_ctype: en_US.UTF-8
177+
lc_collate: en_US.UTF-8
178+
tablespace: my_space
179179
# set custom schema
180180
schemas:
181181
public:
182-
owner: 'localUser'
182+
owner: localUser
183183
# enable per-db extension
184184
{%- if grains.os_family == 'Debian' and grains.osfinger != 'Debian-8' %}
185185
extensions:

0 commit comments

Comments
 (0)