Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite3492bd

Browse files
committed
execute only a small subset of tests for PG_BIN and PG_CONFIG
1 parentb417418 commite3492bd

File tree

4 files changed

+32
-9
lines changed

4 files changed

+32
-9
lines changed

‎.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
env
3+
venv
4+
*.egg-info

‎run_tests.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ time coverage run -a tests/test_simple.py
4242

4343

4444
# run tests (PG_BIN)
45-
export PG_BIN=$(dirname$(which pg_config))
46-
time coverage run -a tests/test_simple.py
47-
unset PG_BIN
45+
time \
46+
PG_BIN=$(dirname$(which pg_config)) \
47+
ALT_CONFIG=1 \
48+
coverage run -a tests/test_simple.py
4849

4950

5051
# run tests (PG_CONFIG)
51-
export PG_CONFIG=$(which pg_config)
52-
time coverage run -a tests/test_simple.py
53-
unset PG_CONFIG
52+
time \
53+
PG_CONFIG=$(which pg_config) \
54+
ALT_CONFIG=1 \
55+
coverage run -a tests/test_simple.py
5456

5557

5658
# show coverage

‎tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export PG_BIN=/path/to/pg/bin
2121

2222
```bash
2323
# Set path to PostgreSQL and python version
24-
export PATH=$PATH:/path/to/pg/bin
24+
export PATH=/path/to/pg/bin:$PATH
2525
export PYTHON_VERSION=3# or 2
2626

2727
# Run tests

‎tests/test_simple.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def removing(f):
6969
os.remove(f)
7070

7171

72-
classSimpleTest(unittest.TestCase):
72+
classTestgresTests(unittest.TestCase):
7373
deftest_custom_init(self):
7474
withget_new_node()asnode:
7575
# enable page checksums
@@ -757,4 +757,21 @@ def test_child_pids(self):
757757

758758

759759
if__name__=='__main__':
760-
unittest.main()
760+
ifos.environ.get('ALT_CONFIG'):
761+
suite=unittest.TestSuite()
762+
763+
# Small subset of tests for alternative configs (PG_BIN or PG_CONFIG)
764+
suite.addTest(TestgresTests('test_pg_config'))
765+
suite.addTest(TestgresTests('test_pg_ctl'))
766+
suite.addTest(TestgresTests('test_psql'))
767+
suite.addTest(TestgresTests('test_replicate'))
768+
769+
print('Running tests for alternative config:')
770+
fortinsuite:
771+
print(t)
772+
print()
773+
774+
runner=unittest.TextTestRunner()
775+
runner.run(suite)
776+
else:
777+
unittest.main()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp