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

ENG-2286 Postgres Integration Test Setup #956

Merged
merged 5 commits into from
Feb 9, 2023

Conversation

agiron123
Copy link
Contributor

@agiron123 agiron123 commented Feb 4, 2023

Describe your changes and why you are making these changes

This PR adds Postgres data integration to the sdk integration tests.

Related issue number (if any)

ENG-2286

Loom demo (if any)

Checklist before requesting a review

  • I have created a descriptive PR title. The PR title should complete the sentence "This PR...".
  • I have performed a self-review of my code.
  • I have included a small demo of the changes. For the UI, this would be a screenshot or a Loom video.
  • If this is a new feature, I have added unit tests and integration tests.
  • I have run the integration tests locally and they are passing.
  • I have run the linter script locally (See python3 scripts/run_linters.py -h for usage).
  • All features on the UI continue to work correctly.
  • Added one of the following CI labels:
    • run_integration_test: Runs integration tests
    • skip_integration_test: Skips integration tests (Should be used when changes are ONLY documentation/UI)

Copy link
Contributor

@likawind likawind left a comment

Choose a reason for hiding this comment

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

The change looks good! Let's work with @kenxu95 to figure the properly way with docker img. The plan overall looks solid to me.

Also a friendly reminder to look at checklist and add setup instructions here

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
Copy link
Contributor

Choose a reason for hiding this comment

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

@kenxu95 I think using these scripts to run / teardown a postgres instance makes sense, but would let you verify

scripts/postgres_test_setup.sh Outdated Show resolved Hide resolved
@likawind
Copy link
Contributor

likawind commented Feb 4, 2023

I don't know if this is your first python project, but great job!

Also, the linter seems to be failing, try if running python3 scripts/run_linters.py --python helps (in your aqueduct repo)

integration_tests/sdk/setup_integration.py Outdated Show resolved Hide resolved
#!/bin/bash

# Create the Docker container
docker run --name aqueduct-postgres -e POSTGRES_PASSWORD=aqueduct -d postgres -p 5432:5432
Copy link
Contributor

Choose a reason for hiding this comment

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

The Docker Postgres image (https://hub.docker.com/_/postgres) has the following environment variable:

POSTGRES_DB
This optional environment variable can be used to define a different name for the default database that is created when the image is first started. If it is not specified, then the value of POSTGRES_USER will be used.

You might be able to just run docker run --name aqueduct-postgres -e POSTGRES_PASSWORD=aqueduct -e POSTGRES_DB=aqueducttest -d postgres -p 5432:5432

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eunice-chan Great catch here, I've updated the setup script to just be one line :)

Copy link
Contributor

@kenxu95 kenxu95 left a comment

Choose a reason for hiding this comment

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

Looks fine to me - we can get back to the setup/teardown scripting stuff later, just make sure to record it on the data setup guides :)

@agiron123 agiron123 added the run_integration_test Triggers integration tests label Feb 7, 2023
@agiron123 agiron123 force-pushed the eng-2286-complete-postgres-integration-testing branch from 26419fa to 62967f2 Compare February 9, 2023 21:35
@agiron123 agiron123 merged commit ce1963a into main Feb 9, 2023
@agiron123 agiron123 deleted the eng-2286-complete-postgres-integration-testing branch February 9, 2023 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run_integration_test Triggers integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants