Skip to content

[tango]: Add integration testing#156

Merged
sywhang merged 2 commits into
uber:mainfrom
JacobOaks:joaks/e2e-test
Jul 10, 2026
Merged

[tango]: Add integration testing#156
sywhang merged 2 commits into
uber:mainfrom
JacobOaks:joaks/e2e-test

Conversation

@JacobOaks

@JacobOaks JacobOaks commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Add some integration testing to tango. These tests:

  • Spin up the tango server, configured with the tango repo itself as the target
  • Create a client connected to it
  • Call its APIs (GetTargetGraph and GetChangedTargets)
  • Asserts some responses from the server against expected data for actual commits in the tango repository.

I decided to use the actual tango repository to provide a heightened realism to the tests.
I also prototype a setup that generated an entire repository with multiple commits at runtime,
but just the boilerplate to bring in rules_go/other basics to support any non-contrived examples
seems to complicate the test code enough that I figured I might as well just use tango itself.
The downside of this approach is that I couldn't easily really assert against any actual piece of the graph
in entirety in testing GetTargetGraph, because it's pretty huge in a real repository with external dependencies. Instead, I assert against some specific expected edges.

This provides a useful signal for how well tango works as an entire system. In a future PR, we can also re-use the same testing components to write benchmarks that measure tango's latency.

This also adds a separate make target and CI step to run this since, in local testing, it can take about a minute or so.

@JacobOaks JacobOaks marked this pull request as ready for review July 8, 2026 18:54
@JacobOaks JacobOaks requested review from a team as code owners July 8, 2026 18:54
Comment thread integration/integration_test.go Outdated
Comment thread integration/integration_test.go Outdated
// 1f2e3e9 Honor OutputConfig include_hashes/include_tags/include_attributes (#116)
// The second commit adds controller/output_filter.go and output_filter_test.go.
const firstSHA = "046de2c20b5492cd5606d32fd632a38b8b70c8f6"
const secondSHA = "1f2e3e9245b159006cf2103becd51c5c1b6ec868"

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.

can this be in Makefile envs instead?

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.

Not sure it makes much sense to do that. These test cases are asserting on expected changed targets for a specific set of SHAs. The expectations are hard-coded, so you can't really change the SHAs using env vars or the test will just.. fail. I think it makes more sense to keep the input next to the expected output.

I think a potential extension eventually would be to move all the shas & expected output into some sort of testdata files rather than hard-coding them, but this is already long-running as it is so not sure it matters until we can support running a lot of these tests somehow.

Comment thread integration/integration_test.go Outdated
Comment thread integration/integration_test.go
@xytan0056

xytan0056 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@sywhang mentioned the integ test can be done in another approach. Could you take a look?

@sywhang

sywhang commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@sywhang mentioned the integ test can be done in another approach. Could you take a look?

That's gonna take a while since we need to write various utils for emulating the git repo workload and do some fancy stuff.

Let's check in at least one E2E test that we can use, since we're about to do some big refactoring.

Add an integration test to tango. This test:
* Spins up the tango server, configured with the tango repo itself as the target
* Creates a client connected to it
* Calls its APIs (GetTargetGraph and GetChangedTargets)
* Asserts some responses from the server against expected data for
  actual commits in the tango repository.

This provides a useful signal for how well tango works as an entire system.
In a future PR, we can also re-use the same testing components
to write benchmarks that measure tango's latency.
@sywhang sywhang merged commit 9cc890f into uber:main Jul 10, 2026
9 checks passed
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