Skip to content

Conversation

@kalleep
Copy link
Contributor

@kalleep kalleep commented Jan 19, 2026

Pull Request Details

We have a issue running our tests on windows

usr/bin/bash: line 1: /c/hostedtoolcache/windows/go/1.25.6/x64/bin/go: Argument list too long

Essentially the output of $(go list ./... | grep -v -E "/integration-tests/|/integration-tests-k8s/") is to large to pass as arguments for windows.

We run this command to exclude our integration tests. To remove this workaround I moved all integration tests from internal/cmd to tests folder. So make tests will now run all tests in internal, extentions/alloyengine and collector. The last two are have their own go mod and we never triggered these tests in ci before.

Issue(s) fixed by this Pull Request

Notes to the Reviewer

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

@kalleep kalleep requested review from a team as code owners January 19, 2026 13:18
@kalleep kalleep removed the request for review from a team January 19, 2026 13:19
@kalleep kalleep changed the title core: Move integration tests and update MakeFile how we run our tests chore: Move integration tests and update MakeFile how we run our tests Jan 19, 2026
@kalleep
Copy link
Contributor Author

kalleep commented Jan 19, 2026

We can now run our tests on windows.

The tests that are failing are already noted down here: #5142

Can address them in a followup pr, don't want it to block this one

Copy link
Contributor

@ptodev ptodev left a comment

Choose a reason for hiding this comment

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

I'm worried that if someone adds a test that's not in /internal, then there's a chance that they won't realise their tests are not being ran by the CI. Isn't it customary to be able to run tests from the same folder where the go.mod is?

Ideally, there should be a good way to exclude integration tests from being ran on windows via the cmd line. If there isn't a good way to do so, we could use comments like //go:build !windows? Those tests use k8s and docker which are more of a Linux thing anyway. To make this more explicit, you could rename the integration-tests folder to integration-tests-linux? In the future we could add another folder called integration-tests-windows to test Windows-specific features.

@ptodev ptodev self-assigned this Jan 19, 2026
- name: Test
run: '& "C:/Program Files/git/bin/bash.exe" -c ''go test -tags="nodocker,nonetwork"
$(go list ./... | grep -v -E "/integration-tests/|/integration-tests-k8s/")'''
run: '& "C:/Program Files/git/bin/bash.exe" -c ''go test -tags="nodocker,nonetwork" ./internal/...'''
Copy link
Contributor

Choose a reason for hiding this comment

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

./internal/... is not enough I think because there are more top-level directories that may now or in the future contain more tests.

We could list all the top-level directories. Or we could use some script to do that automatically and exclude integration-tests/. Or we can use some other go test setting / env variable to skip the integration tests.

@kalleep
Copy link
Contributor Author

kalleep commented Jan 19, 2026

@ptodev @thampiotr in a4d50ad I updated to set integration as build tags for all of our integration tests and update make test to find all directories that contains go.mod and trigger tests there.

I just need to figure out how we can do this for windows too. I also need to add back to manually trigger node_exporter test because it has !race flag. Let me know what you think

@thampiotr
Copy link
Contributor

@ptodev @thampiotr in a4d50ad I updated to set integration as build tags

One issue with tag integration is that it's likely to be a build tag that one of our dependencies would use, which can affect us. I would call it alloy-integration-tests - it doesn't cost much to be a bit more verbose.

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