Skip to content

Setup separate GA jobs for firestore #7523

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

Merged
merged 47 commits into from
Aug 16, 2023
Merged

Setup separate GA jobs for firestore #7523

merged 47 commits into from
Aug 16, 2023

Conversation

wu-hui
Copy link
Contributor

@wu-hui wu-hui commented Aug 3, 2023

This PR utilizes setup different github actions jobs for different flavors of Firestore integration tests, as opposed to running them from one single job. This brings benefits:

  • Better parallelism
  • Better test isolation, and less flakiness
  • By-pass the log clobbering issue with current utility scripts

Please see the new CI checks from the last two commits:

  • without firestore changes (46dfa4e)
  • with firestore changes (df87cac)

@wu-hui wu-hui requested review from a team, dwyfrequency and hsubox76 as code owners August 3, 2023 18:23
@changeset-bot
Copy link

changeset-bot bot commented Aug 3, 2023

⚠️ No Changeset found

Latest commit: 1e17b96

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@wu-hui wu-hui force-pushed the wuandy/ParallelByGH branch 3 times, most recently from dc65363 to a595f19 Compare August 3, 2023 18:39
@wu-hui wu-hui force-pushed the wuandy/ParallelByGH branch from a595f19 to 0809b3a Compare August 3, 2023 18:42
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 3, 2023

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 3, 2023

@wu-hui wu-hui force-pushed the wuandy/ParallelByGH branch 7 times, most recently from 7fa128d to 3aa8e95 Compare August 15, 2023 19:44
@wu-hui wu-hui force-pushed the wuandy/ParallelByGH branch from 3aa8e95 to f6442ef Compare August 15, 2023 20:05
Copy link
Contributor Author

@wu-hui wu-hui left a comment

Choose a reason for hiding this comment

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

I applied some of your suggestions. Some of them seem to lead to other issues, which I do not want to chase down, as all the suggestions are maybe only saving us 30 seconds each run.

- name: Archive build
if: ${{ !cancelled() }}
run: |
tar -cf build.tar .
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This leads to tar complaining the directory changed while archiving, and it only happens with CI.

@wu-hui
Copy link
Contributor Author

wu-hui commented Aug 15, 2023

@DellaBitta

The old Test Firestore on Chrome and Node If Changed check is frozen, and the newly added jobs are not required. Is it because they are not in master yet? Or is there some other place I need to change to make it the way I wanted?


compat-test-chrome:
name: Test Firestore Compatible

Copy link
Contributor

Choose a reason for hiding this comment

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

remove empty lines please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

name: Test Firestore Compatible

runs-on: ubuntu-latest

Copy link
Contributor

Choose a reason for hiding this comment

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

remove empty line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

- name: Run tests if firestore or its dependencies has changed
run: yarn test:changed firestore
id: build
run: yarn build:changed firestore | egrep "Skipping all"
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if there's a build failure that doesn't produce the output Skipping All. Does it still generate an error in steps.build.outcome (which is tested below)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the tests will run and they will fail for missing dependencies because build failed.

Copy link
Contributor

Choose a reason for hiding this comment

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

So if there's a build failure then steps.build.outcome will be success?

Is there a way that we can make this job fail instead, so that the other jobs don't even start? Seems like it would be more clear as to where the problem is when an error occurs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, by piping the output from yarn build:changed firestore through egrep the entire output is lost. So if the build fails there will be no logs indicating why the build failed. Please find a way to do this while preserving the command's output in the logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we could make yarn build:changed > SOME_OUTPUT a separate step, and do the grepping in the next step.

For now, can I get by with a TODO?

Copy link
Contributor

Choose a reason for hiding this comment

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

You'd probably want to redirect stderr as well, so that it shows up inline. Using the tee command seems like a good candidate here:

yarn build:changed 2>&1 | tee ${{ runner.temp }}/yarn.log.txt

This would print the output to stdout and also save it into a temp file. The next line in the step's bash script could run egrep.

- name: Run tests if firestore or its dependencies has changed
run: yarn test:changed firestore
id: build
run: yarn build:changed firestore | egrep "Skipping all"
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, by piping the output from yarn build:changed firestore through egrep the entire output is lost. So if the build fails there will be no logs indicating why the build failed. Please find a way to do this while preserving the command's output in the logs.

- name: Archive build
if: ${{ !cancelled() && steps.build.outcome != 'success' }}
run: |
tar -cf build.tar --exclude="\.git" .
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Change --exclude="\.git" to --exclude=.git because you don't have to "escape" the . character. The pattern given to --exclude is a "glob" pattern (see man 7 glob) which does not treat . specially.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will address in the next PR.

- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: reduce this single-line bash script to one line (i.e. get rid of the pipe | and bring the line below up to this line). Also on lines 113 and 148.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will address in the next PR.

Copy link
Contributor

@dconeybe dconeybe left a comment

Choose a reason for hiding this comment

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

Giving approval to facilitate testing of the changes.

path: build.tar.gz
retention-days: ${{ env.artifactRetentionDays }}

compat-test-chrome:
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 also add a compat-test-firefox? It looks like the old code ran the compat tests on firefox as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will address in the next PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just a reminder to make sure to add compat-test-firefox to this repo's "required" checks when you add it.

Copy link
Contributor Author

@wu-hui wu-hui 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 am going to merge this PR and address the comments in a followup one, such that people can run these checks now.

- name: Archive build
if: ${{ !cancelled() && steps.build.outcome != 'success' }}
run: |
tar -cf build.tar --exclude="\.git" .
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will address in the next PR.

path: build.tar.gz
retention-days: ${{ env.artifactRetentionDays }}

compat-test-chrome:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will address in the next PR.

- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will address in the next PR.

@wu-hui wu-hui merged commit 4ae8041 into master Aug 16, 2023
@wu-hui wu-hui deleted the wuandy/ParallelByGH branch August 16, 2023 18:21
@firebase firebase locked and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants