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

Port last integration tests to python #2966

Merged
merged 6 commits into from
Apr 16, 2024

Conversation

hubertdeng123
Copy link
Member

No description provided.

@hubertdeng123 hubertdeng123 force-pushed the hubertdeng123/port-everything-python branch from 16375ae to f1f43eb Compare April 16, 2024 19:21
Copy link

codecov bot commented Apr 16, 2024

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

❌ Failed Test Results:

Completed 10 tests with 1 failed, 9 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
pytest
Test name:
_integration-test.test_backup::test_sentry_admin
Envs:
- default
No failure message available

@hubertdeng123 hubertdeng123 marked this pull request as ready for review April 16, 2024 21:27
@@ -19,7 +19,8 @@ on the host filesystem. Commands that write files should write them to the '/sen

# Actual invocation that runs the command in the container.
invocation() {
$dc run -v "$VOLUME_MAPPING" --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@"
output=$($dc run -v "$VOLUME_MAPPING" --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@" 2>&1)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a fix, I don't think this was properly working before

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

_integration-test/test_run.py Outdated Show resolved Hide resolved
[x509.NameAttribute(NameOID.COMMON_NAME, "TEST CA *DO NOT TRUST*")]
)

ca_cert = (
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is about 1000x clearer than the one it was replacing, nicely done!

os.remove("sentry/test-custom-ca-roots.py")

# Unset environment variable
if "COMPOSE_FILE" in os.environ:
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing I noticed: this test doesn't seem to have any asserts in it? Is there anything we can do to check that our custom CAs are actually the ones used?

Copy link
Member Author

Choose a reason for hiding this comment

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

It actually does have asserts in it, although it's not very clear. I can put in a comment explaining this in the code, but the asserts come from _integration-test/custom-ca-roots/test.py. The file is copied into the docker volume and executed within the container with the command

subprocess.run(
        [
            "docker",
            "compose",
            "--ansi",
            "never",
            "run",
            "--no-deps",
            "web",
            "python3",
            "/etc/sentry/test-custom-ca-roots.py",
        ],
        check=True,
    )

@@ -19,7 +19,8 @@ on the host filesystem. Commands that write files should write them to the '/sen

# Actual invocation that runs the command in the container.
invocation() {
$dc run -v "$VOLUME_MAPPING" --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@"
output=$($dc run -v "$VOLUME_MAPPING" --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@" 2>&1)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

import subprocess


def test_sentry_admin(setup_backup_restore_env_variables):
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for porting this! :)

@hubertdeng123 hubertdeng123 merged commit b5237d2 into master Apr 16, 2024
12 checks passed
@hubertdeng123 hubertdeng123 deleted the hubertdeng123/port-everything-python branch April 16, 2024 22:51
ngudbhav added a commit to KingsGambitLab/self-hosted-sentry that referenced this pull request Apr 20, 2024
* feat: provide csrf settings information for sentry config (getsentry#2762)

* feat: provide csrf settings information for sentry config

* chore: trim trailing whitespace

* build(deps): bump actions/setup-python from 4 to 5 (getsentry#2644)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hubert Deng <[email protected]>

* Fix groupedmessage indexing error (getsentry#2777)

* fix groupedmessage indexing error

* Check memcached backend in Django (getsentry#2778)

Bail if using old memcached backend

* release: 24.1.2

* build: Set master version to nightly

#skip-changelog

* fix: DB migration script (getsentry#2779)

* use different approach to wait for postgres server

* Tweak postgres indexing fix (getsentry#2792)

* tweak postgres indexing fix

* add exists constraint

* build(deps): bump pre-commit/action from 3.0.0 to 3.0.1 (getsentry#2788)

Bumps [pre-commit/action](https://github.com/pre-commit/action) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/pre-commit/action/releases)
- [Commits](pre-commit/action@v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: pre-commit/action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump nginx version (getsentry#2797)

bump nginx version

* release: 24.2.0

* build: Set master version to nightly

#skip-changelog

* use rust consumers in self-hosted

* revert changes in 3067683

* chore: Use django ORM to perform sql commands (getsentry#2827)

* use django orm

* chore: provide clearer csrf url example (getsentry#2833)

* Upgrade to FSL-1.1 (getsentry#2835)

* simplify if for open-ai-suggestion (getsentry#2732)

* simplify if for open-ai-suggestion

* Add snuba rust consumers (getsentry#2831)

* add snuba rust consumers

* Enable proxy buffering in nginx (getsentry#2844)

Enable proxy buffering

Setting the proxy_buffering directive to “off” is a common mistake because it can cause performance issues and unexpected behavior in NGINX. When proxy buffering is disabled, NGINX receives a response from the proxied server and immediately sends it to the client without storing it in a buffer. This can cause problems if the response is large or if the connection between NGINX and the client is slow, because it can result in increased memory usage and potentially lead to request timeouts.

To avoid this mistake, it is recommended to always enable proxy buffering in NGINX.

* deps: bump maxmind/geoipupdate to 6.1.0 (getsentry#2859)

https://github.com/maxmind/geoipupdate/releases/tag/v6.1.0

* increase postgres max_connections above 100 connections (getsentry#2740)

* use default value and env for postgres max_connections

* Integration test improvements (getsentry#2858)

* integration test improvements

* feat(spans): Ingest spans (getsentry#2861)

* release: 24.3.0

* build: Set master version to nightly

#skip-changelog

* Remove duplicate feature flags (getsentry#2899)

* feat: run outcomes-billing consumer (getsentry#2909)

* Integration tests in python (getsentry#2892)

* integration tests in python

* Fix defunct java processes (getsentry#2914)

revert kafka healthcheck change

* Port backup tests to python (getsentry#2907)

* port backup tests to python

* feat(clickhouse): Added max_suspicious_broken_parts to the config.xml (getsentry#2853)

* feat(clickhouse): Added max_suspicious_broken_parts to the config.xml

* refactor(clickhouse): Set default max_suspicious_bronken_parts and Issue reference

---------

Co-authored-by: Hubert Deng <[email protected]>

* Write Customization tests in python (getsentry#2918)

* port everything integration test related to python

* Bump ubuntu version for tests (getsentry#2923)

* bump ubuntu version used for testing

* get rid of codecov cli dependency

* fix(spans): Adds organizations:standalone-span-ingestion flag to default config (getsentry#2936)

Adds organizations:standalone-span-ingestion flag to default config

* feat: adds group attributes consumer (getsentry#2927)

adds group attributes consumer

* Use python for e2e tests (getsentry#2953)

* bump e2e action commit sha

* release: 24.4.0

* build: Set master version to nightly

#skip-changelog

* Port last integration tests to python (getsentry#2966)

* port custom ca cert test to python

* Add example to docker compose version in problem report (getsentry#2959)

* Use docker compose exec to create additional kafka topics (getsentry#2904)

* chore(deps): bump memcached and redis to latest patch versions (getsentry#2973)

* release: 24.4.1

* build: Set master version to nightly

#skip-changelog

* Add workstation configuration (getsentry#2968)

* Add workstation configuration

These are prebuilt docker images for spinning up a local self-hosted
image on the Google Cloud Workstation project. While primarily intended
for internal development at Sentry, in theory these can be used by
anyone with GCWS project to create a fresh workstation for developing
self-hosted via a remote VSCode connection.

Users who have GCWS properly configured will be able to use the
forthcoming `workstations ...` command in the `sentry` dev CLI to
create, manage, and destroy one-off or long-lived workstations in either
the pre-install or post-install configuration.

Note that the `sentry workstations ...` CLI has not yet landed in the
`sentry` repo - those changes are coming soon!

Issue: getsentry/team-ospo#240

* Fix shfmt complaints

* Upgrade postgres to 14.11 (getsentry#2975)

chore(deps): bump postgres to latest 14 alpine version

* Bump docker compose version in CI (getsentry#2980)

* only rerun tests on v2.0.1

* change from http error to request error

* use 3 retries like before

* fix: backport changes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Reinaldy Rafli <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hubert Deng <[email protected]>
Co-authored-by: Chad Whitacre <[email protected]>
Co-authored-by: getsentry-bot <[email protected]>
Co-authored-by: getsentry-bot <[email protected]>
Co-authored-by: hubertdeng123 <[email protected]>
Co-authored-by: Iven Schlenther <[email protected]>
Co-authored-by: RexTim <[email protected]>
Co-authored-by: Victor <[email protected]>
Co-authored-by: Erfan <[email protected]>
Co-authored-by: Pierre Massat <[email protected]>
Co-authored-by: Jann Kleen <[email protected]>
Co-authored-by: Lyn Nagara <[email protected]>
Co-authored-by: edwardgou-sentry <[email protected]>
Co-authored-by: Stephen Cefali <[email protected]>
Co-authored-by: Edgar Sanchez <[email protected]>
Co-authored-by: Steffen Zieger <[email protected]>
Co-authored-by: Matthew T <[email protected]>
Co-authored-by: Alex Zaslavsky <[email protected]>
ngudbhav pushed a commit to KingsGambitLab/self-hosted-sentry that referenced this pull request Apr 20, 2024
* port custom ca cert test to python
ngudbhav pushed a commit to KingsGambitLab/self-hosted-sentry that referenced this pull request Apr 20, 2024
* port custom ca cert test to python
@github-actions github-actions bot locked and limited conversation to collaborators May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants