ehmatthes / django-simple-deploy

A reusable Django app that configures your project for deployment
BSD 3-Clause "New" or "Revised" License
307 stars 26 forks source link

Run integration tests on Windows #238

Closed ehmatthes closed 4 months ago

ehmatthes commented 1 year ago

Now that unit tests are passing on Windows, make sure integration tests pass on Windows. There's really no way to get to 1.0 without taking this step.

ehmatthes commented 1 year ago
ehmatthes commented 1 year ago

Working notes

ehmatthes commented 1 year ago

Update fly_io deployments

243

ehmatthes commented 1 year ago
ehmatthes commented 1 year ago

Convert platform_sh test from shell to python

ehmatthes commented 1 year ago

Refining platform_sh test

ehmatthes commented 1 year ago

pkg_manager

      Provisioning certificates
        Validating 1 new domain
        E: Error validating domain main-bvxea6i-riad2wf5ov7ek.us-3.platformsh.site: Couldn't complete challenge [HTTP01: The client lacks sufficient authorization]
        Unable to validate domains main-bvxea6i-riad2wf5ov7ek.us-3.platformsh.site, will retry in the background.
        (Next refresh will be at 2023-06-25 05:54:59.392156+00:00.)
ehmatthes commented 1 year ago

Pipenv fails to generate lock file when calling simple_deploy?

From an integration test of local dsd install:

--- Your project is now configured for deployment on Platform.sh. ---

To deploy your project, you will need to:
- Commit the changes made in the configuration process.
    $ git status
    $ git add .
    $ git commit -am "Configured project for deployment."
- Push your project to Platform.sh' servers:
    $ platform push
- Open your project:
    $ platform url    
- As you develop your project further:
    - Make local changes
    - Commit your local changes
    - Run `platform push`

- You can find a full record of this configuration in the simple_deploy_logs directory.
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✘ Locking Failed!
⠼ Locking...
ERROR:pip.subprocessor:[present-rich] Getting requirements to build wheel exited with 1
[ResolutionFailure]:   File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/resolver.py", line 811, in _main
[ResolutionFailure]:       resolve_packages(
[ResolutionFailure]:   File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/resolver.py", line 759, in resolve_packages
[ResolutionFailure]:       results, resolver = resolve(
[ResolutionFailure]:       ^^^^^^^^
[ResolutionFailure]:   File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/resolver.py", line 738, in resolve
[ResolutionFailure]:       return resolve_deps(
[ResolutionFailure]:       ^^^^^^^^^^^^^
[ResolutionFailure]:   File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 1165, in resolve_deps
[ResolutionFailure]:       results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]:       ^^^^^^^^^^^^^^^^^^^^^^
[ResolutionFailure]:   File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 964, in actually_resolve_deps
[ResolutionFailure]:       resolver.resolve()
[ResolutionFailure]:   File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 701, in resolve
[ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv run pip install <requirement_name> to bypass this mechanism, then run $ pipenv graph to inspect the versions actually installed in the virtualenv.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: Getting requirements to build wheel exited with 1

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/__main__.py", line 4, in <module>
    cli()
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/cli/options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/vendor/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/cli/command.py", line 369, in lock
    do_lock(
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/routines/lock.py", line 79, in do_lock
    venv_resolve_deps(
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 1107, in venv_resolve_deps
    c = resolve(cmd, st, project=project)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/gk/y2n2jsfj23g864pdr38rv4ch0000gn/T/pytest-of-eric/pytest-316/blog_project0/b_env/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 1001, in resolve
    raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!

Committing changes...
[main 95dd4d9] Configured for deployment.
 5 files changed, 115 insertions(+), 1 deletion(-)

I believe this was related to psycopg2. That package requires pg_config being on the path. If it's not on the path, Pipenv can't resolve the psycopg2 dependencies.

Fix: Install Postgres, and make sure pg_config is on PATH.

ehmatthes commented 1 year ago
ehmatthes commented 1 year ago

Update Fly.io tests

ehmatthes commented 1 year ago

Update Fly.io deployments

ehmatthes commented 1 year ago

Destroy project in yield section of tmp project fixture

This will allow destruction of the project even if there is a breaking failure.

ehmatthes commented 1 year ago

Update Heroku testing

Note: This took about 20 minutes after all the work on the other two platforms.