Skip to content

Unit tests action - #5

Closed
janzak-dev wants to merge 2 commits into
testfrom
feature/unit_tests_action
Closed

janzak-dev wants to merge 2 commits into
testfrom
feature/unit_tests_action

Conversation

@janzak-dev

@janzak-dev janzak-dev commented Jun 3, 2026 •

Copy link
Copy Markdown
Collaborator

This feature introduces a github action that runs unit tests on demand (and on submissions to this branch)

Currently the full run of a test takes a long while (30-60 minutes) but after applying caching and limiting timeouts to 15 seconds later runs are relatively fast (~5 minutes). It is expected that the test currently fail

8V2YHAqQAWNWbzT

You can inspect all runs of that action here https://github.com/google/xmc/actions?query=workflow%3A%22XMC%20Unit%20Tests%22. Additionally I did a preliminary integration with BTX to better view the runs and manage them. You can see them here https://btx.cloud.google.com/ (if you specify a proper GCP project) - however I wasn't able to get the logs to work.

Future improvements:

  1. Make sure that all tests are green (currently some of those tests are failing) - in progress on this branch Add a spanner emulator to the unit tests action #6
  2. Make this blocking to merges to the test branch

@janzak-dev
janzak-dev force-pushed the feature/unit_tests_action branch from 08a9715 to 3a37054 Compare June 3, 2026 13:15
@janzak-dev
janzak-dev temporarily deployed to janzak-dev-test June 3, 2026 13:15 — with GitHub Actions Inactive
@janzak-dev
janzak-dev temporarily deployed to janzak-dev-test June 3, 2026 13:15 — with GitHub Actions Inactive

@VLukiantsev VLukiantsev left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This and #6 should be reordered to prevent submitting red stuff:

PR A (Test Robustness): Change the base of PR #6 to target test directly, and limit it to only the Go code changes needed to support parallel execution (handling AlreadyExists for instance creation, exposing dynamic DB names from emulator.Setup, and updating runner_test.go to use them). This PR will be green (verified locally).
PR B (this PR #5): Once PR A is merged, rebase PR #5 on test and update the GHA workflow to include the Spanner emulator service. This PR will then run green on GHA and can be merged.

run-tests:
name: 'Run Unit Tests'
runs-on: 'ubuntu-24.04'
environment: janzak-dev-test

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we need some other name for the environment 😄

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I will rename this once the environment gets more stable (I have a task for it, I'd rather not deal with this right now).

pull_request:
push:
branches:
- feature/unit_tests_action

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be updated to the test

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'll add test branch here.

@pachopepe
pachopepe self-requested a review June 5, 2026 08:58
@janzak-dev

Copy link
Copy Markdown
Collaborator Author

@VLukiantsev I don't see a way to answer your comment directly so I'll leave this here.

This and #6 should be reordered to prevent submitting red stuff:

PR A (Test Robustness): Change the base of PR #6 to target test directly, and limit it to only the Go code changes needed to support parallel execution (handling AlreadyExists for instance creation, exposing dynamic DB names from emulator.Setup, and updating runner_test.go to use them). This PR will be green (verified locally).
PR B (this PR #5): Once PR A is merged, rebase PR #5 on test and update the GHA workflow to include the Spanner emulator service. This PR will then run green on GHA and can be merged.

Honestly, I would've preferred to submit this scaffolding and then iterate on this branch, fixing batches of tests until everything is green. Such a flow felt pretty natural to me.

If you're against have red stuff inside the codebase I can:

  • limit the range of tests that are being submitted under this action (in this PR only add tests that are currently green and then iterate on the red ones)
  • make this action only triggered on this branch (this way it won't appear on other people's PRs and won't confuse folks)

What do you think?

@VLukiantsev

Copy link
Copy Markdown
Collaborator

@VLukiantsev I don't see a way to answer your comment directly so I'll leave this here.

This and #6 should be reordered to prevent submitting red stuff:

PR A (Test Robustness): Change the base of PR #6 to target test directly, and limit it to only the Go code changes needed to support parallel execution (handling AlreadyExists for instance creation, exposing dynamic DB names from emulator.Setup, and updating runner_test.go to use them). This PR will be green (verified locally).
PR B (this PR #5): Once PR A is merged, rebase PR #5 on test and update the GHA workflow to include the Spanner emulator service. This PR will then run green on GHA and can be merged.

Honestly, I would've preferred to submit this scaffolding and then iterate on this branch, fixing batches of tests until everything is green. Such a flow felt pretty natural to me.

If you're against have red stuff inside the codebase I can:

  • limit the range of tests that are being submitted under this action (in this PR only add tests that are currently green and then iterate on the red ones)
  • make this action only triggered on this branch (this way it won't appear on other people's PRs and won't confuse folks)

What do you think?

First option LGTM.

This branch was previously deployed

1 inactive deployment
janzak-dev-test — 3a37054c Deployed Jun 3, 2026 by janzak-dev via Run Unit Tests #123
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.

3 participants