Skip to content

Automated Testing#62

Merged
tylercunnion merged 31 commits into
mainfrom
tyler/test-automation
Jul 1, 2026
Merged

Automated Testing#62
tylercunnion merged 31 commits into
mainfrom
tyler/test-automation

Conversation

@tylercunnion

@tylercunnion tylercunnion commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What was changed

Adds automated testing on main and PR branches.

Linting

Adds a golangci-lint configuration synthesized from other core repos in the organization. Linters run only on code changed within the instant pull request. Linters do not run on the main branch.

Unit Testing

Unit tests run on all PR and main builds.

We collect but do not currently do anything with code coverage data. In the future we may want to integrate with Codecov, in line with some of our other projects.

Integration Testing

Integration tests use the server test environment from the OSS server repo, with the WCI component injected in. Integration tests are run against both the pinned version of the server (as defined in go.mod) as well as the current main branch (these are advisory and will not fail the build).

Currently the only defined integration test is a simple smoke test to ensure we can create a worker deployment version, this will be expanded in future work.

Integration tests live in a nested submodule for dependency separation etc; there is a CI job configured to enforce that the versions defined in the respective go.mod files for the go language version as well as the temporal server versions stay in sync. This check will fail the build, in order to prevent drift.

Why?

Enforces code standards as well as ensuring ongoing validation for the codebase.

@tylercunnion tylercunnion marked this pull request as ready for review June 25, 2026 21:15
@tylercunnion tylercunnion requested a review from a team as a code owner June 25, 2026 21:15
Comment thread Makefile
Comment thread tests/go.mod

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.

why do tests get their own go.mod?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Basically trying to isolate them so that a) the dependencies that are there just for integration tests don't leak into the main module; b) it makes the CI a little more straightforward when we want to run integration against two different versions of temporal server.

That said, since I went back on the original idea of actually mocking out portions of the AWS API, I don't think I'm going to end up introducing anything huge into the dependency graph like a Testcontainers or anything. Let me play around with what it would look like to simplify it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's generally good practice for testing-only packages to have their own go.mod, so I support this approach. That said, I'd make the package internal/testing instead of tests at the top-level.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think for now I'm going to leave them where they're at - internal makes more sense if we didn't do the multi-module approach, since that would prevent what's in there from being imported elsewhere; as it is though, since the tests are in their own module, they're already not importable and we'd just be nesting for not a ton of benefit IMO

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 don't quite see how this is a 'testing-only package' as it is more the testing package for the module it is in. @jaypipes looking to learn more: what is the motivation for the practice/what is the problem it is trying to solve?

Comment thread tests/.gitignore Outdated
Comment thread .github/workflows/ci.yaml Outdated
Comment thread tests/integration/wci_test.go Outdated
Comment on lines +55 to +56
err = env.Client.DeleteWorkerControllerInstance(ctx, nsEntry, version, "test-identity")
require.NoError(t, err)

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.

should there be another exists check after this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Works for me yeah

@tylercunnion tylercunnion requested review from a team and 02strich June 30, 2026 22:53

@jaypipes jaypipes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 The integration tests are a lot more valuable than the unit tests (IMHO) and generally easier to reason about and extend. So, +1 from me.

Comment thread tests/go.mod

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's generally good practice for testing-only packages to have their own go.mod, so I support this approach. That said, I'd make the package internal/testing instead of tests at the top-level.

Comment thread .github/workflows/ci.yaml Outdated
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The submodules here refers to Git submodules, not Go modules. Unless you have a very good reason, I'd avoid Git submodules like the plague...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah good call. No reason for git submodules in here at all, I'll nuke that

@tylercunnion tylercunnion merged commit bc7c79f into main Jul 1, 2026
8 checks passed
@tylercunnion tylercunnion deleted the tyler/test-automation branch July 1, 2026 16:54

// emitProviderEvent reports an action to the observer registered for the
// request's deployment build, if any.
func emitProviderEvent(rc RequestContext, action string) {

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.

should this have a more specific name to avoid it colliding with non-test code?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think we can make this emitTestProviderEvent which should avoid any potential collision and be a little more specific about intent

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.

why is this in it's own file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So that we can put the test_dep build tag on and prevent non-test code from attaching an observer here. My preference would probably have been to just have a separate ComputeProvider implementation altogether but it has to pass the validity check (be part of the enum of available Providers) so we can't just put an arbitrary one in there.

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