Skip to content

chore(ci): Run all tests on the oldest golang version#13405

Merged
bboreham merged 1 commit intoprometheus:mainfrom
machine424:ci
Mar 6, 2024
Merged

chore(ci): Run all tests on the oldest golang version#13405
bboreham merged 1 commit intoprometheus:mainfrom
machine424:ci

Conversation

@machine424
Copy link
Copy Markdown
Member

@machine424 machine424 commented Jan 15, 2024

Run test_mixins on the latest golang version

From #13389 (review)

@machine424 machine424 marked this pull request as draft January 15, 2024 18:01
@machine424 machine424 marked this pull request as ready for review January 15, 2024 18:07
@machine424 machine424 marked this pull request as draft January 15, 2024 18:08
@machine424 machine424 force-pushed the ci branch 2 times, most recently from 29d9080 to 3d07a95 Compare January 22, 2024 14:12
go: ["1.20", "1.21"]
container:
image: quay.io/prometheus/golang-builder:1.21-base
image: quay.io/prometheus/golang-builder:${{ matrix.go }}-base
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's simple/ok (for now) to run all the steps for both versions, we can always change if they start diverging.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't like that it runs npm twice. Although they run in parallel, I assume this is chewing up some limited resource.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I though testing a complete build may make sense. Especially for the part where the UI is embedded. But I don't think we test that after all.
how about running common-build? Or should we just go for tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

By the way, the current test runs a complete build:

- run: make build

@machine424 machine424 marked this pull request as ready for review January 22, 2024 14:47
@machine424
Copy link
Copy Markdown
Member Author

cc @bboreham as discussed.

@SuperQ
Copy link
Copy Markdown
Member

SuperQ commented Jan 25, 2024

We need to make sure that the go fmt test does not run in both versions. We've had issues where we have two incompatible formatting versions in the past.

@machine424 machine424 force-pushed the ci branch 2 times, most recently from e3323e0 to dcbf959 Compare January 31, 2024 16:07
@machine424 machine424 force-pushed the ci branch 2 times, most recently from 38395e1 to 28b2f6f Compare February 1, 2024 11:48
@machine424 machine424 requested a review from bboreham February 6, 2024 17:00
@beorn7
Copy link
Copy Markdown
Member

beorn7 commented Feb 27, 2024

@bboreham does this look good to you now?

@machine424 assuming @bboreham's comments are addressed, merge conflicts need to get resolved, and then we can merge.

@machine424 machine424 requested a review from brancz as a code owner February 27, 2024 10:56
@machine424 machine424 marked this pull request as draft February 27, 2024 10:57
@machine424 machine424 force-pushed the ci branch 3 times, most recently from c349d82 to 70c2260 Compare February 27, 2024 11:05
@machine424 machine424 marked this pull request as ready for review February 27, 2024 11:06
@machine424
Copy link
Copy Markdown
Member Author

Thanks, done @beorn7

Comment on lines +39 to +42
- run: make test
- run: go test ./tsdb/ -test.tsdb-isolation=false
- run: go test --tags=stringlabels ./...
- run: GOARCH=386 go test ./cmd/prometheus
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to be doing 3 complete sets of tests plus one subset.
That feels like overkill to me; the point is to catch code that has been added which is incompatible with the older Go. Do you think that further incompatibilities will be caught
under different tags or architecture, such that it's worth spending the time?

ISTM that make test would be simplest, but I could also argue that --tags=stringlabels is the mainline version Prometheus releases with.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If we don't want to take any risks, I'd say yes, we should run the exact go tests than the current version.

  • I'd even add the new go test --tags=dedupelabels ./...
  • I can set the new GO_ONLY=1 to make test to only run go tests.

If we're worried about resources, we can make it a daily test, but that may require more human resources...

Copy link
Copy Markdown
Member Author

@machine424 machine424 Feb 27, 2024

Choose a reason for hiding this comment

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

We can go with make test now, and enrich if we have a slip out in the future.
Your call ;)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The most precious resource is developer time. If this test is the slowest part, then that's what everyone has to wait for:
image

I think 22 minutes is way overkill; please just run one set of tests.
"don't want to take any risks" is not something anyone said about Prometheus.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's go with it then.
(Tell me if I should add the test with -test.tsdb-isolation=false back)

Run test_mixins on the latest golang version

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
Copy link
Copy Markdown
Member

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

Thanks, this looks fine now.

@bboreham bboreham merged commit 620388b into prometheus:main Mar 6, 2024
@bboreham
Copy link
Copy Markdown
Member

bboreham commented Mar 6, 2024

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.

4 participants