Skip to content

Commit

Permalink
docs: highlight neon env comes with an initial timeline (#7995)
Browse files Browse the repository at this point in the history
Quite a few existing test cases create their own timelines instead of
using the default one. This pull request highlights that and hopefully
people can write simpler tests in the future.

Signed-off-by: Alex Chi Z <chi@neon.tech>
Co-authored-by: Yuchen Liang <70461588+yliang412@users.noreply.github.com>
  • Loading branch information
skyzh and yliang412 committed Jun 10, 2024
1 parent b52e31c commit a8ca7a1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test_runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,21 @@ def test_foobar(neon_env_builder: NeonEnvBuilder):
...
```

The env includes a default tenant and timeline. Therefore, you do not need to create your own
tenant/timeline for testing.

```python
def test_foobar2(neon_env_builder: NeonEnvBuilder):
env = neon_env_builder.init_start() # Start the environment
with env.endpoints.create_start("main") as endpoint:
# Start the compute endpoint
client = env.pageserver.http_client() # Get the pageserver client

tenant_id = env.initial_tenant
timeline_id = env.initial_timeline
client.timeline_detail(tenant_id=tenant_id, timeline_id=timeline_id)
```

For more information about pytest fixtures, see https://docs.pytest.org/en/stable/fixture.html

At the end of a test, all the nodes in the environment are automatically stopped, so you
Expand Down

1 comment on commit a8ca7a1

@github-actions
Copy link

Choose a reason for hiding this comment

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

3286 tests run: 3130 passed, 1 failed, 155 skipped (full report)


Failures on Postgres 16

  • test_ancestor_detach_branched_from[False-False-earlier]: debug
# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_ancestor_detach_branched_from[debug-pg16-False-False-earlier]"

Test coverage report is not available

The comment gets automatically updated with the latest test results
a8ca7a1 at 2024-06-10T17:27:52.953Z :recycle:

Please sign in to comment.