Skip to content

Conversation

@tmatsuo
Copy link
Contributor

@tmatsuo tmatsuo commented May 6, 2020

This is a part of #3310 (comment)

This PR also adds cloud-run session.

@tmatsuo tmatsuo added testing do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels May 6, 2020
@tmatsuo tmatsuo requested review from busunkim96 and kurtisvg May 6, 2020 23:32
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 6, 2020
@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 6, 2020

Note: Python 3.8 build should fail because the service account has no permission on my personal project.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 6, 2020

Oh I have typo in the project names, also there's no python3.8 presubmit.
Now python3.7 build should fail.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 6, 2020

The python3.7 build failed as expected.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 7, 2020

py-3.6 successful build with our main project

py-3.7 failed build with my personal project

I'll add the permission and run the test again.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 7, 2020

Both builds succeeded.
py-3.6
py-3.7

@tmatsuo tmatsuo force-pushed the multi-proj branch 2 times, most recently from 0227d0f to 959e8c0 Compare May 7, 2020 17:55
Copy link
Contributor

@kurtisvg kurtisvg left a comment

Choose a reason for hiding this comment

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

It might be easier to propose changes to noxfile-template so it's easier to see what has changed, and also include a new file for testing/showing how its configured.

@tmatsuo

This comment has been minimized.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 8, 2020

Initially I thought it was a good idea to have a file name .test_config.py to "hide" it from other tooling. Like hiding from coverage tool, etc.

But I changed my mind to use a valid file name as python module. For example, if the file name is test_config.py, we can just import it.

I update the PR. @kurtisvg @busunkim96 PTAL

@tmatsuo tmatsuo added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 8, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 8, 2020
@tmatsuo tmatsuo marked this pull request as ready for review May 8, 2020 04:58
@tmatsuo tmatsuo requested a review from a team as a code owner May 8, 2020 04:58
Copy link
Contributor Author

@tmatsuo tmatsuo left a comment

Choose a reason for hiding this comment

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

Thanks! I think I address most of the comments. PTAL

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 8, 2020

Currently py3.7 build is using my personal project and it should fail because I revoked the permissoin.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 8, 2020

Well, it doesn't work as expected on Kokoro. Locally the test failed when I set BUILD_SPECIFIC_GCLOUD_PROJECT.

I need to think about why.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 8, 2020

I gave up being an armchair detective. I'm print-debugging now.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 8, 2020

Ok, now the py-3.7 buid is correctly failing.

Comment on lines +148 to +161
# We currently look at pytest.ini for flake8 config.
# You can add your own exclude and ignore by using `extend-`
#
# Example config:
# [flake8]
# extend-ignore = I100
# extend-exclude = myapp1,myapp2
if os.path.isfile("pytest.ini"):
options += [
"--append-config",
"pytest.ini",
]
options.append(".")
args = FLAKE8_COMMON_ARGS + options
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: IMO, I don't think we should let style checks be configurable, but we can discuss on the next sync

Copy link
Contributor Author

@tmatsuo tmatsuo May 15, 2020

Choose a reason for hiding this comment

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

I agree in general, but it's required for the cloud-run case.

Example:

my_proj
\
 e2e_test.py
 requirements.txt
 my_app1
 \
  main.py
  main_test.py
  requirements.txt

The lint session for the parent my_proj will report that import main is in the wrong place because it doesn't recognize the local import files correctly.

So in this case having following pytest.ini is the cleanest solution IMO:

[pytest]

norecursedirs =  *

[flake8]
extend-exclude = myapp1

This file allows to skip subdirectories both for pytest and flake8.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 15, 2020

The test failed with "google.api_core.exceptions.Aborted: 409 Too many concurrent edits to the project configuration. Please try again.", but this is within our expectation. Restarting the build.

@tmatsuo tmatsuo merged commit 5810701 into GoogleCloudPlatform:master May 15, 2020
@tmatsuo tmatsuo deleted the multi-proj branch May 15, 2020 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement. testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants