Skip to content

Commit b16c555

Browse files
committed
Document test execution instructions for non-Nix systems
1 parent aca6514 commit b16c555

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Multicorn2
55
Multicorn Python3 Foreign Data Wrapper (FDW) for Postgresql. Tested on Linux w/ Python 3.9-3.13 & Postgres 14-18.
66

77
Our latest release, v3.1, supports thru pg18 (and has some testing against Python 3.13).
8-
Newest versions of major linux distro's (Ubuntu 24.04 & EL10) ship with Python 3.12 so sticking with using 3.12 (instead of 3.13) is advised in the short run.
8+
Newest versions of major linux distro's (Ubuntu 24.04 & EL10) ship with Python 3.12 so sticking with using 3.12 (instead of 3.13) is advised in the short run.
99
Python 3.9 is already deprecated by the CPython community and will soon be unsupported by this extension; use 3.10 thru 3.12 instead.
1010

1111
The Multicorn Foreign Data Wrapper allows you to fetch foreign data in Python in your PostgreSQL server.
@@ -90,7 +90,7 @@ When using a pre-built Postgres installed using your OS package manager, you wil
9090
On Debian/Ubuntu systems:
9191
```bash
9292
sudo apt install -y build-essential ... postgresql-server-dev-17
93-
sudo apt install -y python3 python3-dev python3-setuptools python3-pip
93+
sudo apt install -y python3 python3-dev python3-setuptools python3-pip python-is-python3
9494
```
9595

9696
On CentOS/Rocky/Redhat systems:
@@ -128,7 +128,24 @@ However, both can be installed on the same system without conflict. Since PL/Py
128128

129129
## Integration tests
130130

131-
multicorn2 has an extensive suite of integration tests which run against live PostgreSQL servers. In order to manage the matrix of supported versions of Python and PostgreSQL, the Nix package manager can be used to provide all the dependencies and run all the tests. The Nix package manager is supported on Linux, MacOS, and Windows Subsystem for Linux. To install Nix, follow the instructions at https://nixos.org/download/.
131+
multicorn2 has an extensive suite of integration tests which run against live PostgreSQL servers.
132+
133+
### Running Tests
134+
135+
After following the development environment steps in [Install Dependencies for Building the Multicorn2 extension](#install-dependencies-for-building-postgres--the-multicorn2-extension), the tests can be invoked by running `make easycheck`.
136+
137+
`easycheck` does not compile or install the multicorn2 module. A typical development cycle at this point would be to build & install the updated module into the system's PostgreSQL server, and then run `easycheck`:
138+
139+
```
140+
sudo make install
141+
PATH=$PATH:$(pg_config --bindir) make easycheck
142+
```
143+
144+
(`PATH=$PATH:$(pg_config --bindir)` is added because in some systems, specifically Ubuntu, some commands like `initdb` are not available on the `PATH` by default)
145+
146+
### Test Matrix
147+
148+
In order to manage the matrix of supported versions of Python and PostgreSQL, the Nix package manager can be used to provide all the dependencies and run all the tests. The Nix package manager is supported on Linux, MacOS, and Windows Subsystem for Linux. To install Nix, follow the instructions at https://nixos.org/download/.
132149

133150
Once Nix is installed, you can run the tests with the following commands. To run a complete regression test against all supported versions of Python and PostgreSQL, run:
134151

@@ -138,13 +155,13 @@ nix build .#allTestSuites
138155

139156
This can be slow to run when it is first executed (15-30 minutes) due to the need to rebuild PostgreSQL with specific versions of Python, to support the plpython extension which is used in some tests. Subsequent runs will be faster (under 5 minutes) as the build artifacts are cached.
140157

141-
To run a faster test suite against a specific version of Python and PostgreSQL, run:
158+
To run a subset of the test suite against a specific version of PostgreSQL and Python, customize the version numbers and run a build such as:
142159

143160
```bash
144161
nix build .#testSuites.test_pg18_py312
145162
```
146163

147-
### Adding new Python or PostgreSQL versions to the test suite
164+
#### Adding new Python or PostgreSQL versions to the test suite
148165

149166
1. Perform a `nix flake update` in order to provide access to the latest packages available from the Nix package manager.
150167

0 commit comments

Comments
 (0)