GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Noxfile check for tests by leahecole · Pull Request #7342 · GoogleCloudPlatform/python-docs-samples

Conversation

@leahecole

@leahecole leahecole commented Jan 10, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

This adds a check to the noxfile to see if there are tests in the directory. To test, use the noxfile-template in any directory with tests. Then try it on a directory like this one which is found in PR #7291. This does assume that all tests are of the format *_test.py - if we want, I can also include a check for test_*.py, because I know that's a common Python pattern even though it's not the one we use.

Corresponding PR in synthtool googleapis/synthtool#1321

cc @davidcavazos - this will hopefully remove the need for your workaround

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
leahecole added 3 commits January 10, 2022 11:29
@leahecole
Add check for tests
c39f2bb
@leahecole
fix typo
771847c
@leahecole
run blacken
3a10c3c
@leahecole
leahecole requested a review from a team as a code owner January 10, 2022 19:39
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Jan 10, 2022
@blunderbuss-gcf blunderbuss-gcf Bot assigned dandhlee Jan 10, 2022
@leahecole leahecole mentioned this pull request Jan 10, 2022
chore: Add check for tests in directory googleapis/synthtool#1321
Merged
@davidcavazos

davidcavazos commented Jan 10, 2022

Copy link
Copy Markdown

Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

David Cavazos
Merge branch 'main' into noxfile-check-for-tests
093a53d
@davidcavazos
davidcavazos self-requested a review January 10, 2022 21:07
davidcavazos
davidcavazos approved these changes Jan 10, 2022
View reviewed changes

@davidcavazos davidcavazos left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@leahecole
also check for test_ files
961d9bd
busunkim96
busunkim96 approved these changes Jan 11, 2022
View reviewed changes
@leahecole
Merge branch 'main' into noxfile-check-for-tests
6df9a44
@leahecole leahecole added the automerge Merge the pull request once unit tests and other checks pass. label Jan 11, 2022
gcf-merge-on-green Bot pushed a commit to googleapis/synthtool that referenced this pull request Jan 11, 2022
@leahecole
chore: Add check for tests in directory (#1321)
0a58b14
See GoogleCloudPlatform/python-docs-samples#7342 for more info
@gcf-merge-on-green

gcf-merge-on-green Bot commented Jan 11, 2022

Copy link
Copy Markdown
Contributor

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jan 11, 2022
@leahecole
Merge branch 'main' into noxfile-check-for-tests
09dda45
@leahecole leahecole added the automerge Merge the pull request once unit tests and other checks pass. label Jan 11, 2022
@gcf-merge-on-green
gcf-merge-on-green Bot merged commit 100354a into main Jan 11, 2022
@gcf-merge-on-green
gcf-merge-on-green Bot deleted the noxfile-check-for-tests branch January 11, 2022 18:02
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jan 11, 2022
@leahecole leahecole mentioned this pull request Jan 11, 2022
Added sample for geospatial classification #7291
Merged
@glasnt glasnt mentioned this pull request Apr 11, 2022
Reassert idp-sql and django tests #7779
Merged
8 tasks
gcf-merge-on-green Bot pushed a commit that referenced this pull request Apr 20, 2022
@glasnt
Reassert idp-sql and django tests (#7779)
fde487c
## 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](https://docs.djangoproject.com/en/4.0/releases/4.0/#dropped-support-for-postgresql-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
- [ ] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md)
- [ ] README is updated to include [all relevant information](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#readme-file)
- [ ] **Tests** pass:   `nox -s py-3.6` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup))
- [ ] **Lint** pass:   `nox -s lint` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup))
- [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones)
- [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones)
- [ ] Please **merge** this PR for me once it is approved.
- [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/.github/CODEOWNERS) with the codeowners for this sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@davidcavazos davidcavazos davidcavazos approved these changes
@busunkim96 busunkim96 busunkim96 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dandhlee dandhlee

Labels

samples Issues that are directly related to samples.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@leahecole @davidcavazos @busunkim96 @dandhlee
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.