Skip to content
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

pythonPackages.testing-postgresql: init at unstable-2017-10-31 #74716

Merged

Conversation

jluttine
Copy link
Member

@jluttine jluttine commented Nov 30, 2019

Motivation for this change

Add testing.postgresql Python package and its dependencies and fixes to dependencies.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@jluttine jluttine changed the title Init testing common database 2.0.3 pythonPackages.testing-postgresql: init at unstable-2017-10-31 Nov 30, 2019
@ofborg ofborg bot requested a review from domenkozar November 30, 2019 01:25
@jluttine jluttine force-pushed the init-testing-common-database-2.0.3 branch from 19bc2a6 to 6a83ffd Compare December 4, 2019 11:11
@jluttine
Copy link
Member Author

jluttine commented Mar 9, 2020

@jonringer Shall you or someone else approve/review this?

@jluttine jluttine force-pushed the init-testing-common-database-2.0.3 branch from 6a83ffd to d907f10 Compare March 11, 2020 07:40
@jluttine jluttine force-pushed the init-testing-common-database-2.0.3 branch 2 times, most recently from 8f49766 to 1b77c49 Compare March 11, 2020 07:54
@jluttine
Copy link
Member Author

@jonringer I made the review fixes and rebased so that there are no merge conflicts.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff LGTM

[13 built, 5 copied (6.3 MiB), 1.3 MiB DL]
https://github.com/NixOS/nixpkgs/pull/74716
9 package built:
python27Packages.testing-common-database python37Packages.pg8000 python37Packages.scramp python37Packages.testing-common-database python37Packages.testing-postgresql python38Packages.pg8000 python38Packages.scramp python38Packages.testing-common-database python38Packages.testing-postgresql

@jonringer
Copy link
Contributor

@GrahamcOfBorg build python27Packages.testing-common-database python37Packages.pg8000 python37Packages.scramp python37Packages.testing-common-database python37Packages.testing-postgresql python38Packages.pg8000 python38Packages.scramp python38Packages.testing-common-database python38Packages.testing-postgresql

@jonringer
Copy link
Contributor

__darwinAllowLocalNetworking = true; might work for the darwin build, if it doesn't, then i would just mark this package as linux only.

@jluttine
Copy link
Member Author

@jonringer Can I somehow test that locally on a Linux machine? Or should I just disable for darwin..?

@jonringer
Copy link
Contributor

@jonringer Can I somehow test that locally on a Linux machine? Or should I just disable for darwin..?

It builds fine on linux, you mean darwin?

@jluttine
Copy link
Member Author

I meant: can I build for darwin on linux? If I cannot do that, then I should probably just disable darwin.

@jonringer
Copy link
Contributor

do you mind applying my suggestions, and then I can check if ofborg is able to do the darwin build successfully

@jluttine jluttine force-pushed the init-testing-common-database-2.0.3 branch from 1b77c49 to f476475 Compare March 31, 2020 08:00
@jluttine
Copy link
Member Author

@jonringer Done.

@jonringer
Copy link
Contributor

@GrahamcOfBorg build python27Packages.testing-common-database python37Packages.pg8000 python37Packages.scramp python37Packages.testing-common-database python37Packages.testing-postgresql python38Packages.pg8000 python38Packages.scramp python38Packages.testing-common-database python38Packages.testing-postgresql

@jonringer
Copy link
Contributor

actually, the darwin builder is pretty backed up, It will most likely timeout

@jluttine jluttine force-pushed the init-testing-common-database-2.0.3 branch from f476475 to 7f3e0a9 Compare April 9, 2020 05:37
@jluttine
Copy link
Member Author

jluttine commented Apr 9, 2020

nixpkgs review passes:

$ nixpkgs-reivew pr 74716
...
9 package built:
python27Packages.testing-common-database python37Packages.pg8000 python37Packages.scramp python37Packages.testing-common-database python37Packages.testing-postgresql python38Packages.pg8000 python38Packages.scramp python38Packages.testing-common-database python38Packages.testing-postgresql

@jluttine
Copy link
Member Author

jluttine commented Nov 16, 2020

@jonringer I've now fixed merge conflicts that had emerged since April. Is this still good to merge or should I still do something? Who could do the merging?

@jluttine
Copy link
Member Author

Oh, apparently there's still a conflict. scramp have now recently been added to nixpkgs outside this PR. So, I need to modify this a bit.

@jluttine jluttine force-pushed the init-testing-common-database-2.0.3 branch from bf06db5 to 418f8eb Compare November 16, 2020 19:35
@jluttine
Copy link
Member Author

jluttine commented Nov 16, 2020

Alright, conflicts resolved. I now removed scramp addition because it was already recently added to nixpkgs. Also, fixing of pg800 with scramp input was removed because the same fix was recently done in nixpkgs. Perhaps I should've reminded about this PR earlier because now there had been duplicate work on adding scramp and fixing pg800 which I had done already long time ago in this PR. But still this PR contains two new packages that would be nice to get merged.

@SuperSandro2000
Copy link
Member

Fails to build for me:

Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing setuptools-check-hook
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/slqzfj67fc121m106yypd4lqzh808rrv-source
source root is source
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/tox.ini
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Executing setuptoolsBuildPhase
running bdist_wheel
The [wheel] section is deprecated. Use [bdist_wheel] instead.
running build
running build_py
creating _build
creating _build/lib
creating _build/lib/testing
copying src/testing/postgresql.py -> _build/lib/testing
copying src/testing/__init__.py -> _build/lib/testing
running egg_info
creating src/testing.postgresql.egg-info
writing src/testing.postgresql.egg-info/PKG-INFO
writing dependency_links to src/testing.postgresql.egg-info/dependency_links.txt
writing namespace_packages to src/testing.postgresql.egg-info/namespace_packages.txt
writing requirements to src/testing.postgresql.egg-info/requires.txt
writing top-level names to src/testing.postgresql.egg-info/top_level.txt
writing manifest file 'src/testing.postgresql.egg-info/SOURCES.txt'
reading manifest file 'src/testing.postgresql.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src/testing.postgresql.egg-info/SOURCES.txt'
installing to _build/bdist.linux-x86_64/wheel
running install
running install_lib
Skipping installation of _build/bdist.linux-x86_64/wheel/testing/__init__.py (namespace package)
copying testing/postgresql.py -> _build/bdist.linux-x86_64/wheel/testing
running install_egg_info
Copying src/testing.postgresql.egg-info to _build/bdist.linux-x86_64/wheel/testing.postgresql-1.3.0-py3.8.egg-info
Installing _build/bdist.linux-x86_64/wheel/testing.postgresql-1.3.0-py3.8-nspkg.pth
running install_scripts
adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
creating _build/bdist.linux-x86_64/wheel/testing.postgresql-1.3.0.dist-info/WHEEL
creating 'dist/testing.postgresql-1.3.0-py2.py3-none-any.whl' and adding '_build/bdist.linux-x86_64/wheel' to it
adding 'testing.postgresql-1.3.0-py3.8-nspkg.pth'
adding 'testing/postgresql.py'
adding 'testing.postgresql-1.3.0.dist-info/LICENSE'
adding 'testing.postgresql-1.3.0.dist-info/METADATA'
adding 'testing.postgresql-1.3.0.dist-info/WHEEL'
adding 'testing.postgresql-1.3.0.dist-info/namespace_packages.txt'
adding 'testing.postgresql-1.3.0.dist-info/top_level.txt'
adding 'testing.postgresql-1.3.0.dist-info/RECORD'
removing _build/bdist.linux-x86_64/wheel
Finished executing setuptoolsBuildPhase
@nix { "action": "setPhase", "phase": "installPhase" }
installing
Executing pipInstallPhase
/build/source/dist /build/source
�[33mDEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.�[0m
Processing ./testing.postgresql-1.3.0-py2.py3-none-any.whl
Requirement already satisfied: pg8000>=1.10 in /nix/store/3qp0fbihgavcdbp7xj0mlza1p59gsql2-python3.8-pg8000-1.16.6/lib/python3.8/site-packages (from testing.postgresql==1.3.0) (1.16.6)
Requirement already satisfied: testing.common.database>=1.1.0 in /nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages (from testing.postgresql==1.3.0) (2.0.3)
Requirement already satisfied: scramp==1.2.0 in /nix/store/gd7v3zwgsjw0rbxib5kdpvccwvffdm6a-python3.8-scramp-1.2.0/lib/python3.8/site-packages (from pg8000>=1.10->testing.postgresql==1.3.0) (1.2.0)
Installing collected packages: testing.postgresql
Successfully installed testing.postgresql-1.3.0
/build/source
Finished executing pipInstallPhase
@nix { "action": "setPhase", "phase": "fixupPhase" }
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31
strip is /nix/store/p3kn26g5nhmx6spn37ar3mn0xjbzks3g-binutils-2.31.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib 
patching script interpreter paths in /nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31
checking for references to /build/ in /nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31...
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
@nix { "action": "setPhase", "phase": "installCheckPhase" }
running install tests
�[1m============================= test session starts ==============================�[0m
platform linux -- Python 3.8.6, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
rootdir: /build/source
�[1mcollecting ... �[0m�[1m
collected 17 items                                                             �[0m

tests/test_postgresql.py �[31mF�[0m�[31mF�[0m�[31mF�[0m�[31mF�[0m�[32m.�[0m�[31mF�[0m�[31mF�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[31mF�[0m�[31mF�[0m�[31mF�[0m�[31m                               [100%]�[0m

=================================== FAILURES ===================================
�[31m�[1m____________________ TestPostgresql.test_PostgresqlFactory _____________________�[0m

self = <test_postgresql.TestPostgresql testMethod=test_PostgresqlFactory>

    def test_PostgresqlFactory(self):
>       Postgresql = testing.postgresql.PostgresqlFactory(cache_initialized_db=True)

�[1m�[31mtests/test_postgresql.py�[0m:237: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:53: in __init__
    self.cache.setup()
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:125: in setup
    self.initialize_database()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff5e797c0>

    def initialize_database(self):
        if not os.path.exists(os.path.join(self.base_dir, 'data', 'PG_VERSION')):
            args = ([self.initdb, '-D', os.path.join(self.base_dir, 'data'), '--lc-messages=C'] +
                    self.settings['initdb_args'].split())
    
            try:
                p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                output, err = p.communicate()
                if p.returncode != 0:
>                   raise RuntimeError("initdb failed: %r" % err)
�[1m�[31mE                   RuntimeError: initdb failed: b'popen failure: Cannot allocate memory\nThe program "postgres" is needed by initdb but was not found in the\nsame directory as "/nix/store/vb8fjkkncl03h837k3mcfil3pw3fyrp7-postgresql-11.9/bin/initdb".\nCheck your installation.\n'�[0m

�[1m�[31m/nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib/python3.8/site-packages/testing/postgresql.py�[0m:87: RuntimeError
�[31m�[1m________ TestPostgresql.test_PostgresqlFactory_with_initialized_handler ________�[0m

self = <test_postgresql.TestPostgresql testMethod=test_PostgresqlFactory_with_initialized_handler>

    def test_PostgresqlFactory_with_initialized_handler(self):
        def handler(pgsql):
            conn = pg8000.connect(**pgsql.dsn())
            with closing(conn.cursor()) as cursor:
                cursor.execute("CREATE TABLE hello(id int, value varchar(256))")
                cursor.execute("INSERT INTO hello values(1, 'hello'), (2, 'ciao')")
            conn.commit()
            conn.close()
    
>       Postgresql = testing.postgresql.PostgresqlFactory(cache_initialized_db=True,
                                                          on_initialized=handler)

�[1m�[31mtests/test_postgresql.py�[0m:256: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:40: in __init__
    self.cache = self.target_class(**self.settings)
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:96: in __init__
    self.setup()
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:125: in setup
    self.initialize_database()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff5e30340>

    def initialize_database(self):
        if not os.path.exists(os.path.join(self.base_dir, 'data', 'PG_VERSION')):
            args = ([self.initdb, '-D', os.path.join(self.base_dir, 'data'), '--lc-messages=C'] +
                    self.settings['initdb_args'].split())
    
            try:
                p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                output, err = p.communicate()
                if p.returncode != 0:
>                   raise RuntimeError("initdb failed: %r" % err)
�[1m�[31mE                   RuntimeError: initdb failed: b'popen failure: Cannot allocate memory\nThe program "postgres" is needed by initdb but was not found in the\nsame directory as "/nix/store/vb8fjkkncl03h837k3mcfil3pw3fyrp7-postgresql-11.9/bin/initdb".\nCheck your installation.\n'�[0m

�[1m�[31m/nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib/python3.8/site-packages/testing/postgresql.py�[0m:87: RuntimeError
�[31m�[1m__________________________ TestPostgresql.test_basic ___________________________�[0m

self = <test_postgresql.TestPostgresql testMethod=test_basic>

    def test_basic(self):
        try:
            # start postgresql server
>           pgsql = testing.postgresql.Postgresql()

�[1m�[31mtests/test_postgresql.py�[0m:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff6ac8850>, kwargs = {}

    def __init__(self, **kwargs):
        self.name = self.__class__.__name__
        self.settings = dict(self.DEFAULT_SETTINGS)
        self.settings.update(kwargs)
        self.child_process = None
        self._owner_pid = os.getpid()
        self._use_tmpdir = False
    
        if os.name == 'nt':
            self.terminate_signal = signal.CTRL_BREAK_EVENT
    
        self.base_dir = self.settings.pop('base_dir')
        if self.base_dir:
            if self.base_dir[0] != '/':
                self.base_dir = os.path.join(os.getcwd(), self.base_dir)
        else:
            self.base_dir = tempfile.mkdtemp()
            self._use_tmpdir = True
    
        try:
            self.initialize()
    
            if self.settings['auto_start']:
                if self.settings['auto_start'] >= 2:
>                   self.setup()

�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:96: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff6ac8850>

    def setup(self):
        # copy data files
        if self.settings['copy_data_from']:
            try:
                data_dir = self.get_data_directory()
                copytree(self.settings['copy_data_from'], data_dir)
                os.chmod(data_dir, 0o700)
            except Exception as exc:
                raise RuntimeError("could not copytree %s to %s: %r" %
                                   (self.settings['copy_data_from'], data_dir, exc))
    
        # create directory tree
        for subdir in self.subdirectories:
            path = os.path.join(self.base_dir, subdir)
            if not os.path.exists(path):
                os.makedirs(path)
                os.chmod(path, 0o700)
    
        try:
>           self.initialize_database()

�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:125: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff6ac8850>

    def initialize_database(self):
        if not os.path.exists(os.path.join(self.base_dir, 'data', 'PG_VERSION')):
            args = ([self.initdb, '-D', os.path.join(self.base_dir, 'data'), '--lc-messages=C'] +
                    self.settings['initdb_args'].split())
    
            try:
                p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                output, err = p.communicate()
                if p.returncode != 0:
>                   raise RuntimeError("initdb failed: %r" % err)
�[1m�[31mE                   RuntimeError: initdb failed: b'popen failure: Cannot allocate memory\nThe program "postgres" is needed by initdb but was not found in the\nsame directory as "/nix/store/vb8fjkkncl03h837k3mcfil3pw3fyrp7-postgresql-11.9/bin/initdb".\nCheck your installation.\n'�[0m

�[1m�[31m/nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib/python3.8/site-packages/testing/postgresql.py�[0m:87: RuntimeError

�[33mDuring handling of the above exception, another exception occurred:�[0m

self = <test_postgresql.TestPostgresql testMethod=test_basic>

    def test_basic(self):
        try:
            # start postgresql server
            pgsql = testing.postgresql.Postgresql()
            self.assertIsNotNone(pgsql)
            params = pgsql.dsn()
            self.assertEqual('test', params['database'])
            self.assertEqual('127.0.0.1', params['host'])
            self.assertEqual(pgsql.settings['port'], params['port'])
            self.assertEqual('postgres', params['user'])
    
            # connect to postgresql (w/ psycopg2)
            conn = psycopg2.connect(**pgsql.dsn())
            self.assertIsNotNone(conn)
            self.assertRegexpMatches(pgsql.read_bootlog(), 'is ready to accept connections')
            conn.close()
    
            # connect to postgresql (w/ sqlalchemy)
            engine = sqlalchemy.create_engine(pgsql.url())
            self.assertIsNotNone(engine)
    
            # connect to postgresql (w/ pg8000)
            conn = pg8000.connect(**pgsql.dsn())
            self.assertIsNotNone(conn)
            self.assertRegexpMatches(pgsql.read_bootlog(), 'is ready to accept connections')
            conn.close()
        finally:
            # shutting down
>           pid = pgsql.server_pid
�[1m�[31mE           UnboundLocalError: local variable 'pgsql' referenced before assignment�[0m

�[1m�[31mtests/test_postgresql.py�[0m:45: UnboundLocalError
�[31m�[1m______________________ TestPostgresql.test_copy_data_from ______________________�[0m

self = <test_postgresql.TestPostgresql testMethod=test_copy_data_from>

    def test_copy_data_from(self):
        try:
            tmpdir = tempfile.mkdtemp()
    
            # create new database
>           with testing.postgresql.Postgresql(base_dir=tmpdir) as pgsql:

�[1m�[31mtests/test_postgresql.py�[0m:143: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:96: in __init__
    self.setup()
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:125: in setup
    self.initialize_database()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff5ddfe80>

    def initialize_database(self):
        if not os.path.exists(os.path.join(self.base_dir, 'data', 'PG_VERSION')):
            args = ([self.initdb, '-D', os.path.join(self.base_dir, 'data'), '--lc-messages=C'] +
                    self.settings['initdb_args'].split())
    
            try:
                p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                output, err = p.communicate()
                if p.returncode != 0:
>                   raise RuntimeError("initdb failed: %r" % err)
�[1m�[31mE                   RuntimeError: initdb failed: b'popen failure: Cannot allocate memory\nThe program "postgres" is needed by initdb but was not found in the\nsame directory as "/nix/store/vb8fjkkncl03h837k3mcfil3pw3fyrp7-postgresql-11.9/bin/initdb".\nCheck your installation.\n'�[0m

�[1m�[31m/nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib/python3.8/site-packages/testing/postgresql.py�[0m:87: RuntimeError
�[31m�[1m___________________________ TestPostgresql.test_fork ___________________________�[0m

self = <test_postgresql.TestPostgresql testMethod=test_fork>

    @unittest.skipIf(os.name == 'nt', 'Windows does not have fork()')
    def test_fork(self):
>       pgsql = testing.postgresql.Postgresql()

�[1m�[31mtests/test_postgresql.py�[0m:116: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:96: in __init__
    self.setup()
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:125: in setup
    self.initialize_database()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff5de2b80>

    def initialize_database(self):
        if not os.path.exists(os.path.join(self.base_dir, 'data', 'PG_VERSION')):
            args = ([self.initdb, '-D', os.path.join(self.base_dir, 'data'), '--lc-messages=C'] +
                    self.settings['initdb_args'].split())
    
            try:
                p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                output, err = p.communicate()
                if p.returncode != 0:
>                   raise RuntimeError("initdb failed: %r" % err)
�[1m�[31mE                   RuntimeError: initdb failed: b'popen failure: Cannot allocate memory\nThe program "postgres" is needed by initdb but was not found in the\nsame directory as "/nix/store/vb8fjkkncl03h837k3mcfil3pw3fyrp7-postgresql-11.9/bin/initdb".\nCheck your installation.\n'�[0m

�[1m�[31m/nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib/python3.8/site-packages/testing/postgresql.py�[0m:87: RuntimeError
�[31m�[1m___________________ TestPostgresql.test_multiple_postgresql ____________________�[0m

self = <test_postgresql.TestPostgresql testMethod=test_multiple_postgresql>

    def test_multiple_postgresql(self):
>       pgsql1 = testing.postgresql.Postgresql()

�[1m�[31mtests/test_postgresql.py�[0m:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:96: in __init__
    self.setup()
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:125: in setup
    self.initialize_database()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff5e6b070>

    def initialize_database(self):
        if not os.path.exists(os.path.join(self.base_dir, 'data', 'PG_VERSION')):
            args = ([self.initdb, '-D', os.path.join(self.base_dir, 'data'), '--lc-messages=C'] +
                    self.settings['initdb_args'].split())
    
            try:
                p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                output, err = p.communicate()
                if p.returncode != 0:
>                   raise RuntimeError("initdb failed: %r" % err)
�[1m�[31mE                   RuntimeError: initdb failed: b'popen failure: Cannot allocate memory\nThe program "postgres" is needed by initdb but was not found in the\nsame directory as "/nix/store/vb8fjkkncl03h837k3mcfil3pw3fyrp7-postgresql-11.9/bin/initdb".\nCheck your installation.\n'�[0m

�[1m�[31m/nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib/python3.8/site-packages/testing/postgresql.py�[0m:87: RuntimeError
�[31m�[1m___________________________ TestPostgresql.test_stop ___________________________�[0m

self = <test_postgresql.TestPostgresql testMethod=test_stop>

    def test_stop(self):
        # start postgresql server
>       pgsql = testing.postgresql.Postgresql()

�[1m�[31mtests/test_postgresql.py�[0m:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:96: in __init__
    self.setup()
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:125: in setup
    self.initialize_database()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff628a220>

    def initialize_database(self):
        if not os.path.exists(os.path.join(self.base_dir, 'data', 'PG_VERSION')):
            args = ([self.initdb, '-D', os.path.join(self.base_dir, 'data'), '--lc-messages=C'] +
                    self.settings['initdb_args'].split())
    
            try:
                p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                output, err = p.communicate()
                if p.returncode != 0:
>                   raise RuntimeError("initdb failed: %r" % err)
�[1m�[31mE                   RuntimeError: initdb failed: b'popen failure: Cannot allocate memory\nThe program "postgres" is needed by initdb but was not found in the\nsame directory as "/nix/store/vb8fjkkncl03h837k3mcfil3pw3fyrp7-postgresql-11.9/bin/initdb".\nCheck your installation.\n'�[0m

�[1m�[31m/nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib/python3.8/site-packages/testing/postgresql.py�[0m:87: RuntimeError
�[31m�[1m__________________ TestPostgresql.test_stop_on_child_process ___________________�[0m

self = <test_postgresql.TestPostgresql testMethod=test_stop_on_child_process>

    @unittest.skipIf(os.name == 'nt', 'Windows does not have fork()')
    def test_stop_on_child_process(self):
>       pgsql = testing.postgresql.Postgresql()

�[1m�[31mtests/test_postgresql.py�[0m:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:96: in __init__
    self.setup()
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:125: in setup
    self.initialize_database()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff5e55460>

    def initialize_database(self):
        if not os.path.exists(os.path.join(self.base_dir, 'data', 'PG_VERSION')):
            args = ([self.initdb, '-D', os.path.join(self.base_dir, 'data'), '--lc-messages=C'] +
                    self.settings['initdb_args'].split())
    
            try:
                p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                output, err = p.communicate()
                if p.returncode != 0:
>                   raise RuntimeError("initdb failed: %r" % err)
�[1m�[31mE                   RuntimeError: initdb failed: b'popen failure: Cannot allocate memory\nThe program "postgres" is needed by initdb but was not found in the\nsame directory as "/nix/store/vb8fjkkncl03h837k3mcfil3pw3fyrp7-postgresql-11.9/bin/initdb".\nCheck your installation.\n'�[0m

�[1m�[31m/nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib/python3.8/site-packages/testing/postgresql.py�[0m:87: RuntimeError
�[31m�[1m______________________ TestPostgresql.test_with_statement ______________________�[0m

self = <test_postgresql.TestPostgresql testMethod=test_with_statement>

    def test_with_statement(self):
>       with testing.postgresql.Postgresql() as pgsql:

�[1m�[31mtests/test_postgresql.py�[0m:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:96: in __init__
    self.setup()
�[1m�[31m/nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py�[0m:125: in setup
    self.initialize_database()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testing.postgresql.Postgresql object at 0x7ffff5ddd850>

    def initialize_database(self):
        if not os.path.exists(os.path.join(self.base_dir, 'data', 'PG_VERSION')):
            args = ([self.initdb, '-D', os.path.join(self.base_dir, 'data'), '--lc-messages=C'] +
                    self.settings['initdb_args'].split())
    
            try:
                p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                output, err = p.communicate()
                if p.returncode != 0:
>                   raise RuntimeError("initdb failed: %r" % err)
�[1m�[31mE                   RuntimeError: initdb failed: b'popen failure: Cannot allocate memory\nThe program "postgres" is needed by initdb but was not found in the\nsame directory as "/nix/store/vb8fjkkncl03h837k3mcfil3pw3fyrp7-postgresql-11.9/bin/initdb".\nCheck your installation.\n'�[0m

�[1m�[31m/nix/store/bx4l4nf6n1k0ki1akdg721smzpaal0h2-python3.8-testing.postgresql-unstable-2017-10-31/lib/python3.8/site-packages/testing/postgresql.py�[0m:87: RuntimeError
�[33m=============================== warnings summary ===============================�[0m
tests/test_postgresql.py::TestPostgresql::test_skipIfNotFound_found
  /nix/store/lygpkvwlfmq09p8wyqfnxhn6nr8nx43j-python3.8-testing.common.database-2.0.3/lib/python3.8/site-packages/testing/common/database.py:288: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    if isinstance(arg, collections.Callable):  # execute as simple decorator

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED tests/test_postgresql.py::TestPostgresql::test_PostgresqlFactory - Run...
FAILED tests/test_postgresql.py::TestPostgresql::test_PostgresqlFactory_with_initialized_handler
FAILED tests/test_postgresql.py::TestPostgresql::test_basic - UnboundLocalErr...
FAILED tests/test_postgresql.py::TestPostgresql::test_copy_data_from - Runtim...
FAILED tests/test_postgresql.py::TestPostgresql::test_fork - RuntimeError: in...
FAILED tests/test_postgresql.py::TestPostgresql::test_multiple_postgresql - R...
FAILED tests/test_postgresql.py::TestPostgresql::test_stop - RuntimeError: in...
FAILED tests/test_postgresql.py::TestPostgresql::test_stop_on_child_process
FAILED tests/test_postgresql.py::TestPostgresql::test_with_statement - Runtim...
�[31m==================== �[31m�[1m9 failed�[0m, �[32m8 passed�[0m, �[33m1 warning�[0m�[31m in 0.68s�[0m�[31m ====================�[0m

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 74716 run on x86_64-linux 1

5 packages built:
  • python27Packages.testing-common-database
  • python37Packages.testing-common-database
  • python37Packages.testing-postgresql
  • python38Packages.testing-common-database
  • python38Packages.testing-postgresql

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 74716 run on x86_64-darwin 1

2 packages failed to build and are new build failures:
3 packages built:
  • python27Packages.testing-common-database
  • python37Packages.testing-common-database
  • python38Packages.testing-common-database

@jluttine jluttine force-pushed the init-testing-common-database-2.0.3 branch from 418f8eb to 33e4fd1 Compare January 24, 2021 16:34
@jluttine
Copy link
Member Author

@SuperSandro2000 Thanks for the review! The failures on darwin say things like:

RuntimeError: initdb failed: b'2021-01-18 20:13:04.344 UTC [44809] FATAL:  could not create shared memory segment: Operation not permitted

No idea if this is easy or even possible to fix. Should I just disable this package for darwin? I now set platforms = platforms.linux for that package which was broken on darwin. Is that sufficient or do I need to specify it somewhere else too?

@jluttine jluttine force-pushed the init-testing-common-database-2.0.3 branch from 42e52c7 to e4fb0f3 Compare January 24, 2021 16:40
@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 74716 run on x86_64-darwin 1

3 packages built:
  • python37Packages.testing-common-database
  • python38Packages.testing-common-database
  • python39Packages.testing-common-database

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 74716 run on x86_64-linux 1

6 packages built:
  • python37Packages.testing-common-database
  • python37Packages.testing-postgresql
  • python38Packages.testing-common-database
  • python38Packages.testing-postgresql
  • python39Packages.testing-common-database
  • python39Packages.testing-postgresql

@SuperSandro2000 SuperSandro2000 merged commit ff7ba7a into NixOS:master Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants