Skip to content

More fixes for creating the site and running tests - #2

Merged
jladage merged 3 commits into
mainfrom
maurits-fixes-2
Oct 8, 2026
Merged

jladage merged 3 commits into
mainfrom
maurits-fixes-2

Conversation

@mauritsvanrees

Copy link
Copy Markdown
Member

No description provided.

Sneaky: even with `DELETE_SITE=1` and after `make stack-remove-data`, this new setting was not picked up in a new `make stack-start`.
Why?  Because I still had an earlier plone Docker image with the unchanged `create-site.py` script...
When you install `plone.app.caching`, you can go to the Import Settings tab to apply a preconfigured set of caching rules.
This is also what we do in the `create_site.py` script since the previous commit.

Otherwise, so with a plain install of `plone.app.caching` and nothing else, 37 out of 77 tests fail in `make stack-test`:

```
ERROR at setup of test_plone_purges_changed_content[moderate]

request = <SubRequest 'caching_policy' for <Function test_bot_is_tracked[moderate-Claude-User-user]>>, stack = <stack.helpers.Stack object at 0x110018ec0>

    @pytest.fixture(scope="session", params=["site", "moderate"])
    def caching_policy(request, stack):
        """Run tests with the site's caching policy, and with moderateCaching.

        By default Plone does not let Varnish cache pages.  With moderateCaching
        for pages Varnish caches them for SMAXAGE seconds.  The original policy
        is restored afterwards.
        """
        if request.param == "moderate":
            original_mapping = stack.registry_get(OPERATION_MAPPING)
            original_smaxage = stack.registry_get(MODERATE_SMAXAGE)
>           mapping = dict(original_mapping)
                      ^^^^^^^^^^^^^^^^^^^^^^
E           TypeError: 'NoneType' object is not iterable
```

With this small fix in `conftest.py`, those tests pass whether such a preconfigured set of caching rules is applied or not.
These compiled files should not be in git.
When you run `make release`, this installs `zest.releaser` and `zest.pocompile`, which makes sure `.mo` files are generated before creating the Python package distribution.
@mauritsvanrees
mauritsvanrees requested a review from jladage October 8, 2026 10:00
@jladage
jladage merged commit 01a59ba into main Oct 8, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants