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

[Tour Of Beam][backend] integration tests and GA workflow #23032

Merged
merged 23 commits into from
Sep 8, 2022

Conversation

eantyshev
Copy link
Contributor

@eantyshev eantyshev commented Sep 5, 2022

addresses #23005

Basic integration tests, GitHub action-wrapped, and a bit of a boilerplate to run it locally
Essentially an acceptance test.

  1. Setup and run Datastore emulator in background process
  2. Compile Cloud Functions and run them in background
  3. Execute CD step for samples/learning-content
  4. Run integration tests that call CFs via HTTP client. Compare responses with those from samples/api.
  5. Datastore emulator generates indexes while the queries are executed. Compare it with VCS version. We will use it in future Cloud Deployment workflow.

Example workflow run:
https://github.com/akvelon/beam/runs/8192798498


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@eantyshev eantyshev marked this pull request as ready for review September 6, 2022 08:46
@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2022

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @Abacn for label build.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@olehborysevych
Copy link
Collaborator

lgtm

@olehborysevych
Copy link
Collaborator

R: @damccorm

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2022

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

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

This generally looks good to me, left a few small comments

Comment on lines +31 to +34
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I wasn't familiar with this feature - neat!

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, I added #23089 because I think we should be doing this more broadly - thanks for introducing it to the repo 😄

- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.16'
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Could we add a comment explaining we're pinning to 1.16 because Google Cloud Functions don't support higher versions (ideally here and in tour_of_beam_backend.yml)? That way we avoid a well meaning contributor (or dependabot) bumping the version.

learning/tour-of-beam/backend/integration_tests/client.go Outdated Show resolved Hide resolved
@@ -24,7 +24,7 @@ FROM google/cloud-sdk:$GCLOUD_SDK_VERSION
VOLUME /opt/data

# RUN mkdir -p /opt/data/WEB-INF
COPY index.yaml /opt/data/WEB-INF/index.yaml
# COPY index.yaml /opt/data/WEB-INF/index.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just remove this entirely? Why did we end up moving this?

Copy link
Contributor Author

@eantyshev eantyshev Sep 8, 2022

Choose a reason for hiding this comment

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

This was my initial idea of how to validate Datastore indexes: by copying it to the Datastore emulator container
But that actually doesn't work: emulator updates WEB-INF/index.yaml when it executes the query which requires a composite index.
So, in this PR we switch to comparing the generated index.yaml with our VCS version after the tests
Assuming integration tests covered every possible Datastore query, it produces an index that must work when deployed to Cloud

The line has to be removed, I overlooked that I only commented it

Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

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

LGTM - thanks!

@damccorm damccorm merged commit 9efa378 into apache:master Sep 8, 2022
@eantyshev eantyshev deleted the tob_integration_tests branch September 12, 2022 10:20
dedocibula pushed a commit to dedocibula/beam that referenced this pull request Sep 15, 2022
* tests

* WF

* chdir

* order

* nit

* fix

* nit

* concurrency

* integration_go

* tags

* cache_go

* nit

* nit

* rat

* datadir

* env

* env

* reduce fun

* removing unicode character

* Update learning/tour-of-beam/backend/integration_tests/client.go

Co-authored-by: Danny McCormick <[email protected]>

* Update learning/tour-of-beam/backend/integration_tests/function_test.go

Co-authored-by: Danny McCormick <[email protected]>

* review

* nit

Co-authored-by: oborysevych <[email protected]>
Co-authored-by: Danny McCormick <[email protected]>
kkdoon pushed a commit to twitter-forks/beam that referenced this pull request Sep 29, 2022
* tests

* WF

* chdir

* order

* nit

* fix

* nit

* concurrency

* integration_go

* tags

* cache_go

* nit

* nit

* rat

* datadir

* env

* env

* reduce fun

* removing unicode character

* Update learning/tour-of-beam/backend/integration_tests/client.go

Co-authored-by: Danny McCormick <[email protected]>

* Update learning/tour-of-beam/backend/integration_tests/function_test.go

Co-authored-by: Danny McCormick <[email protected]>

* review

* nit

Co-authored-by: oborysevych <[email protected]>
Co-authored-by: Danny McCormick <[email protected]>
cushon pushed a commit to cushon/beam that referenced this pull request Oct 17, 2022
* tests

* WF

* chdir

* order

* nit

* fix

* nit

* concurrency

* integration_go

* tags

* cache_go

* nit

* nit

* rat

* datadir

* env

* env

* reduce fun

* removing unicode character

* Update learning/tour-of-beam/backend/integration_tests/client.go

Co-authored-by: Danny McCormick <[email protected]>

* Update learning/tour-of-beam/backend/integration_tests/function_test.go

Co-authored-by: Danny McCormick <[email protected]>

* review

* nit

Co-authored-by: oborysevych <[email protected]>
Co-authored-by: Danny McCormick <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants