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

chore: run buildpack integration test on pull request #255

Merged
merged 2 commits into from
Jul 12, 2023

Conversation

kenneth-rosario
Copy link
Contributor

No description provided.

@kenneth-rosario kenneth-rosario force-pushed the kennethrosario/make-integ-test-run-on-pull branch 2 times, most recently from a979e31 to 0e2b5e7 Compare June 28, 2023 20:23
@kenneth-rosario kenneth-rosario force-pushed the kennethrosario/make-integ-test-run-on-pull branch from 0e2b5e7 to 2a4c8ed Compare July 6, 2023 22:26
@kenneth-rosario kenneth-rosario marked this pull request as ready for review July 6, 2023 22:32
@kenneth-rosario kenneth-rosario added the blunderbuss: assign Instruct blunderbuss to assign someone label Jul 6, 2023
@blunderbuss-gcf blunderbuss-gcf bot removed the blunderbuss: assign Instruct blunderbuss to assign someone label Jul 6, 2023
cat requirements.txt

echo $PYTHON_VERSION >.python-version
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this required for the test to use the right python version? Was the builder-runtime env not being used for this purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason it was not picking up the correct version. See https://github.com/GoogleCloudPlatform/functions-framework-python/actions/runs/5073551086/jobs/9112706450#step:6:493 for example of the builder getting and using python v 3.11 when the action was asking for python37 . See https://github.com/GoogleCloudPlatform/functions-framework-python/actions/runs/5480718756/jobs/9984237010?pr=255#step:6:287 on example of how after adding file it is using the right version.

Not sure if we have been always testing with latest python version or if this bug appeared later on.

Copy link
Contributor Author

@kenneth-rosario kenneth-rosario Jul 6, 2023

Choose a reason for hiding this comment

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

I was able to reproduce by just running builder in local function

Steps to repro:

1. mkdir ~/my-repro cd ~/my-repro
2. main.py

import functions_framework

@functions_framework.http
def hello(request):
    return "Hello world!"
  1. requirements file requirements.txt
functions-framework==3.4.0
  1. Run buildpack
    pack build --builder gcr.io/buildpacks/builder:latest --env GOOGLE_FUNCTION_TARGET=hello--env X_GOOGLE_TARGET_PLATFORM=gcf --env GOOGLE_FUNCTION_SOURCE=. --env GOOGLE_RUNTIME=python37 --trust-builder --verbose my-first-function > test.log

  2. It logs:
    Python version not specified, using the latest available version.

.github/workflows/buildpack-integration-test.yml Outdated Show resolved Hide resolved
@kenneth-rosario kenneth-rosario force-pushed the kennethrosario/make-integ-test-run-on-pull branch from 2a4c8ed to 66fecc2 Compare July 6, 2023 23:08
@kenneth-rosario kenneth-rosario marked this pull request as draft July 7, 2023 22:24
@kenneth-rosario kenneth-rosario force-pushed the kennethrosario/make-integ-test-run-on-pull branch from 66fecc2 to 67d5ce3 Compare July 10, 2023 23:19
@kenneth-rosario kenneth-rosario marked this pull request as ready for review July 11, 2023 00:06
@kenneth-rosario
Copy link
Contributor Author

@KaylaNguyen I modified conformance client to accept a runtime version flag that populates GOOGLE_RUNTIME_VERSION env var when building instead of doing a language specific way of pinning the version.

@kenneth-rosario kenneth-rosario merged commit 671f2cb into master Jul 12, 2023
64 checks passed
@kenneth-rosario kenneth-rosario deleted the kennethrosario/make-integ-test-run-on-pull branch July 12, 2023 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants