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

[MAINTENANCE] Run cloud e2e tests. #8443

Merged
merged 20 commits into from Aug 1, 2023
Merged

[MAINTENANCE] Run cloud e2e tests. #8443

merged 20 commits into from Aug 1, 2023

Conversation

billdirks
Copy link
Contributor

@billdirks billdirks commented Jul 27, 2023

  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB]
  • Code is linted - run invoke lint (uses black + ruff)
  • Appropriate tests and docs have been updated

For more details, see our Contribution Checklist, Coding style guide, and Documentation style guide.

After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!

@github-actions github-actions bot added the core label Jul 27, 2023
@netlify
Copy link

netlify bot commented Jul 27, 2023

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit 472ebba
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/64c893f8f5ef25000888b906

@ghost
Copy link

ghost commented Jul 27, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@billdirks billdirks enabled auto-merge (squash) July 28, 2023 02:20
@billdirks billdirks disabled auto-merge July 28, 2023 02:40
@@ -107,8 +107,7 @@ jobs:
markers:
- big
- cli
# `not e2e` because 1 test & 1 fixture need access token
- cloud and not e2e
Copy link
Contributor Author

@billdirks billdirks Jul 28, 2023

Choose a reason for hiding this comment

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

I will need to update the branch protection rules before this will merge.
Also, after this merges I will need to add the cloud step as a required test.

@@ -137,6 +136,10 @@ jobs:
invoke deps --gx-install -m '${{ matrix.markers }}' -r test

- name: Run the tests
env:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I should only set these env variables for the cloud mark stage?

Copy link
Member

Choose a reason for hiding this comment

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

There may be a way to conditionally inject env vars with gh actions but another simpler solution could be to just break the steps that need different env vars to their own job.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that sounds like a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to leave it like this for this PR and move it out later if we want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I will move this out now. Setting the environmental variables cause a lot of issues. I will file a followup ticket to review this further. It only impacts people who are both gx cloud and OSS developers.

@@ -819,7 +819,8 @@ def test_config_substitution_retains_original_value_on_save(
from great_expectations import get_context

context = get_context(
context_root_dir=file_dc_config_file_with_substitutions.parent
context_root_dir=file_dc_config_file_with_substitutions.parent,
ge_cloud_mode=False,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've set the cloud env variables for all marker stages so had to make sure these didn't get a cloud context.
Maybe I should just set the env variables on the cloud marker test? Or maybe I should do both. These tests should be robust to the env variables.

Copy link
Contributor Author

@billdirks billdirks Jul 28, 2023

Choose a reason for hiding this comment

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

Doing things like this let's me get rid of that darwin check in __init__.py. Ultimately, making the tests pass independent of a developer's environment is better. Currently linux users would fail these tests if they have gx cloud env variables set. I still see tests dying though because I've set the env variables in all marker tests. Hopefully isn't a pain to clean up as we go.

Copy link
Contributor Author

@billdirks billdirks Jul 28, 2023

Choose a reason for hiding this comment

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

I will move and use the fixture I introduced and use that instead of setting the ge_cloud_mode parameter.

Comment on lines 346 to 353
@pytest.fixture()
def _unset_gx_env_variables(monkeypatch: pytest.MonkeyPatch) -> None:
for var in GXCloudEnvironmentVariable:
monkeypatch.delenv(var, raising=False)


# TODO: There is something wrong with this test. It is trying to mock out cloud but if I don't
# unset the gx_env_variables (eg if i remove this fixture) this test will fail.
Copy link
Member

Choose a reason for hiding this comment

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

I had a similar approach in this abandoned effort from about a month ago.
Except in that case I was injecting dummy Cloud variables for the non e2e tests.

Unsetting the gx_env variables might be something we want to apply to the test session setup???

Copy link
Contributor Author

@billdirks billdirks Jul 28, 2023

Choose a reason for hiding this comment

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

We do need to normalize our environment somehow. If I unset these across the board the tests that require these environment variables set will fail. We need a way that is not burdensome to a test writer that gets this correct.

@Kilo59 Kilo59 enabled auto-merge (squash) July 28, 2023 23:42
@Kilo59 Kilo59 merged commit 43c6c66 into develop Aug 1, 2023
64 checks passed
@Kilo59 Kilo59 deleted the m/pp-358/run_cloud_tests branch August 1, 2023 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants