Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: run linux package tests nightly against latest contrib main #666

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

mowies
Copy link
Member

@mowies mowies commented Sep 19, 2024

This PR enables nightly testing of the otelcol-contrib linux packages based on the latest main branch version of otelcol-contrib built in https://github.com/open-telemetry/opentelemetry-collector-contrib.
This change was made possible by splitting the otelcol-contrib gorelease config into 2 separate files, one for building and one for packaging/archives/docker images/etc.
(The split goreleaser build is a goreleaser pro feature)

Using the split building approach was the only viable option to achieve this. I did lots of research on this, it was talked about in the Collector SIG meeting and I also asked the GoReleaser folks for their help.

Consequences of this change:

  • better testing
  • slightly less maintainability of the goreleaser files and generator code for otelcol-contrib since they have special handling now

Fixes #659

@mowies mowies force-pushed the nightly-package-tests branch 3 times, most recently from ccfa4e8 to a24cc4e Compare September 30, 2024 08:25
@mowies mowies force-pushed the nightly-package-tests branch 3 times, most recently from d492610 to 9e0c3e6 Compare November 12, 2024 11:03
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
@@ -6,7 +6,7 @@ BUILDER=''
# default values
skipcompilation=false

while getopts d:s:b:g: flag
while getopts d:s:b: flag
Copy link
Member Author

@mowies mowies Nov 21, 2024

Choose a reason for hiding this comment

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

removed unused flag which should have been removed in #727

Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
@mowies mowies changed the title run package tests nightly against latest main test: run package tests nightly against latest contrib main Nov 21, 2024
Signed-off-by: Moritz Wiesinger <[email protected]>
@mowies mowies changed the title test: run package tests nightly against latest contrib main test: run linux package tests nightly against latest contrib main Nov 25, 2024
@mowies mowies marked this pull request as ready for review November 25, 2024 08:16
@mowies mowies requested a review from a team as a code owner November 25, 2024 08:16
.github/workflows/base-package-tests.yaml Outdated Show resolved Hide resolved
.github/workflows/base-ci-goreleaser.yaml Outdated Show resolved Hide resolved
.github/workflows/base-ci-goreleaser.yaml Outdated Show resolved Hide resolved
@mowies
Copy link
Member Author

mowies commented Nov 27, 2024

@mx-psi i fixed all your remarks, pls re-review when you find some time :)

Comment on lines +89 to +90
- name: Create artifacts directory to store build artifacts
run: mkdir -p distributions/otelcol-contrib/artifacts
Copy link
Member

Choose a reason for hiding this comment

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

Should this be conditional on latest being true as well?

Copy link
Member

Choose a reason for hiding this comment

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

Could we more cleanly separate the steps that are part of the nightly tests vs the ones that are not?

For example, we can have a "(Nightly)" prefix on the name of all of them

On the code itself, I was wondering if we can have an uses directive and that way we only have to check once that the inputs look correct

@@ -12,6 +12,10 @@ on:
goarch:
required: true
type: string
latest:
Copy link
Member

Choose a reason for hiding this comment

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

Should this be called nightly? Also, could you add a description to this field so it is clear what it does?

--json databaseId \
--jq '.[0].databaseId' \
)
echo "Found run ID: $run_id"
Copy link
Member

Choose a reason for hiding this comment

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

What happens if a run id is not found?

Copy link
Member

Choose a reason for hiding this comment

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

How will we be able to tell if there is an error? I think we should create a release:blocker issue if there is a failed test. We can do this in a follow up PR if you want to.

Comment on lines +137 to +139
if dist == K8sDistro {
return nil
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this, this wasn't here before, right?

"gopkg.in/yaml.v3"

"github.com/open-telemetry/opentelemetry-collector-releases/cmd/goreleaser/internal"
)

var distFlag = flag.String("d", "", "Collector distributions to build")
var contribBuildOrRestFlag = flag.Bool("b", false, "Collector Contrib distribution only - switch between build and package config file - set to true to generate build step, false to generate package step")
Copy link
Member

Choose a reason for hiding this comment

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

I know the precedent is not great but... can we use a more descriptive name for this flag? --generate-build-step?

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.

Add nightly linux package tests
2 participants