Skip to content

Reassert idp-sql and django tests - #7779

Merged
gcf-merge-on-green[bot] merged 7 commits into
GoogleCloudPlatform:mainfrom
glasnt:topic/tests
Apr 20, 2022
Merged

Reassert idp-sql and django tests#7779
gcf-merge-on-green[bot] merged 7 commits into
GoogleCloudPlatform:mainfrom
glasnt:topic/tests

Conversation

@glasnt

@glasntglasnt commented Apr 11, 2022

Copy link
Copy Markdown
Contributor

Description

#7342 introduced a change where nox would check for test_*.py and *_test.py files. Django and IDP-SQL had their tests in test/, so this glob didn't find these files, and these tests haven't been run for a bit.

Outstanding issues with these tests:

dynamic PR status update follows


  • Django: Postgres 9.6 EOL
Step #6 - "Migrate database": django.db.utils.ProgrammingError: column c.relispartition does not exist
Step #6 - "Migrate database": LINE 3: CASE WHEN c.relispartition THEN 'p' WHEN c.relki...
Step #6 - "Migrate database": 

Debugging seems to indicate this happens on old versions of postgres. Django 4.0 no longer supports Postgres 9.6. test-instance-pg is Postgres 9.6, which is EOL as of November 2021.

Suggest creating a newer versioned instance of a postgres testing database (happy to help here where I can).

Update: test-instance-pg has been updated to Postgres 14


  • IDP: Linting issues
./middleware.py:31:29: ANN401 Dynamically typed expressions (typing.Any) are disallowed
def decorated_function(*args: Any, **kwargs: Any) -> Any:
^
./middleware.py:31:42: ANN401 Dynamically typed expressions (typing.Any) are disallowed
def decorated_function(*args: Any, **kwargs: Any) -> Any:
^
./middleware.py:31:61: ANN401 Dynamically typed expressions (typing.Any) are disallowed
def decorated_function(*args: Any, **kwargs: Any) -> Any:
^

This is being addressed as of v2.9.0 of flake8-annotations. sco1/flake8-annotations#136

It will require adding --allow-star-arg-any to the flake8 call.

Update: while this flag could be used, I opted to use the TypeVar method in #7789


Checklist

@product-auto-labelproduct-auto-labelBot added the samples Issues that are directly related to samples. label Apr 11, 2022
@glasntglasnt changed the title Move idp-sql and django tests to confirm with standardReassert idp-sql and django testsApr 11, 2022

@averikitschaverikitsch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @glasnt

@ace-n

ace-n commented Apr 12, 2022

Copy link
Copy Markdown

I'm on board w/ this as a temporary fix, but this looks like a good opportunity to use Terraform + fresh GCP projects.

(Terraform abstracts away retries. We'd need to update our CI infrastructure, though. Googlers, see this link.)

@glasnt
glasnt marked this pull request as ready for review April 19, 2022 23:13
@glasnt
glasnt requested review from a team as code ownersApril 19, 2022 23:13
@leahecoleleahecole added the automerge Merge the pull request once unit tests and other checks pass. label Apr 20, 2022
@gcf-merge-on-green
gcf-merge-on-greenBot merged commit fde487c into GoogleCloudPlatform:mainApr 20, 2022
@gcf-merge-on-greengcf-merge-on-greenBot removed the automerge Merge the pull request once unit tests and other checks pass. label Apr 20, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samplesIssues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@glasnt@ace-n@averikitsch@leahecole