Skip to content

minor hotfix for OptionTest.test_help_6, OptionTest.test_version_2 an… #494

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 1 commit into from
Jun 16, 2022
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
31 changes: 30 additions & 1 deletion tests/Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[see wiki](https://confluence.postgrespro.ru/display/DEV/pg_probackup)
****[see wiki](https://confluence.postgrespro.ru/display/DEV/pg_probackup)

```
Note: For now these tests work on Linux and "kinda" work on Windows
Expand Down Expand Up @@ -50,3 +50,32 @@ Usage:
export PG_CONFIG=/path/to/pg_config
python -m unittest [-v] tests[.specific_module][.class.test]
```

### Troubleshooting FAQ

#### python test failures
1. Test failure reason like
```
testgres.exceptions.QueryException ERROR: could not open extension control file "/home/avaness/postgres/postgres.build/share/extension/amcheck.control": No such file or directory
```

*Solution*: you have no `<postgres_src_root>/contrib/` extensions installed

```commandline
cd <postgres_src_root>
make world install
```

2. Test failure

```
FAIL: test_help_6 (tests.option.OptionTest)
```

*Solution*: you didn't configure postgres build with `--enable-nls`

```commandline
cd <postgres_src_root>
make distclean
<your-./configure-cmdline> --enable-nls
```
1 change: 1 addition & 0 deletions tests/expected/option_help_ru.out
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ pg_probackup - утилита для управления резервным к
[--remote-proto] [--remote-host]
[--remote-port] [--remote-path] [--remote-user]
[--ssh-options]
[--dry-run]
[--help]

Подробнее читайте на сайте <https://github.com/postgrespro/pg_probackup>.
Expand Down
2 changes: 1 addition & 1 deletion tests/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_version_2(self):
"""help options"""
with open(os.path.join(self.dir_path, "expected/option_version.out"), "rb") as version_out:
self.assertIn(
version_out.read().decode("utf-8"),
version_out.read().decode("utf-8").strip(),
self.run_pb(["--version"])
)

Expand Down