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

fix(pkg/build): fixed flaky test. #23

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!-- Thanks for sending a pull request! Here are some tips for you:

1. If this is your first time, please read our contributor guidelines in the [CONTRIBUTING.md](https://github.com/falcosecurity/.github/CONTRIBUTING.md) file.
2. Please label this pull request according to what type of issue you are addressing.
3. Please add a release note!
4. If the PR is unfinished while opening it specify a wip in the title before the actual title, for example, "wip: my awesome feature"
-->

**What type of PR is this?**

> Uncomment one (or more) `/kind <>` lines:

> /kind bug

> /kind cleanup

> /kind design

> /kind documentation

> /kind failing-test

> /kind feature

<!--
Please remove the leading whitespace before the `/kind <>` you uncommented.
-->

**Any specific area of the project related to this PR?**

> Uncomment one (or more) `/area <>` lines:

> /area build

> /area cmd

> /area pkg

> /area docs

> /area tests


**What this PR does / why we need it**:

**Which issue(s) this PR fixes**:

<!--
Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
If PR is `kind/failing-tests` or `kind/flaky-test`, please post the related issues/tests in a comment and do not use `Fixes`.
-->

Fixes #

**Special notes for your reviewer**:

**Does this PR introduce a user-facing change?**:

<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below.
If the PR requires additional action from users switching to the new release, prepend the string "action required:".
For example, `action required: change the API interface of the rule engine`.
-->

```release-note

```
60 changes: 30 additions & 30 deletions pkg/build/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestBuild(t *testing.T) {
RepoRoot: "./test",
Target: root.Target{
Distro: "centos",
KernelRelease: "5.14.0-361.el9.x86_64",
KernelRelease: "5.14.0-362.el9.x86_64",
KernelVersion: "1",
},
},
Expand All @@ -49,15 +49,15 @@ func TestBuild(t *testing.T) {
IgnoreErrors: false,
},
expectedLocalObjects: []string{
"falco_centos_5.14.0-361.el9.x86_64_1.ko",
"falco_centos_5.14.0-361.el9.x86_64_1.o",
"falco_centos_5.14.0-362.el9.x86_64_1.ko",
"falco_centos_5.14.0-362.el9.x86_64_1.o",
},
expectedBucketObjects: []string{
"falco_centos_5.14.0-361.el9.x86_64_1.ko",
"falco_centos_5.14.0-361.el9.x86_64_1.o",
"falco_centos_5.14.0-362.el9.x86_64_1.ko",
"falco_centos_5.14.0-362.el9.x86_64_1.o",
},
shouldCreate: true,
name: "build 5.0.1+driver centos 5.14.0-361.el9.x86_64",
name: "build 5.0.1+driver centos 5.14.0-362.el9.x86_64",
},
{
opts: Options{
Expand All @@ -68,7 +68,7 @@ func TestBuild(t *testing.T) {
RepoRoot: "./test",
Target: root.Target{
Distro: "centos",
KernelRelease: "5.14.0-354.el9.x86_64",
KernelRelease: "5.14.0-364.el9.x86_64",
KernelVersion: "1",
},
},
Expand All @@ -77,17 +77,17 @@ func TestBuild(t *testing.T) {
IgnoreErrors: false,
},
expectedLocalObjects: []string{
"falco_centos_5.14.0-354.el9.x86_64_1.ko",
"falco_centos_5.14.0-354.el9.x86_64_1.o",
"falco_centos_5.14.0-361.el9.x86_64_1.ko",
"falco_centos_5.14.0-361.el9.x86_64_1.o",
"falco_centos_5.14.0-364.el9.x86_64_1.ko",
"falco_centos_5.14.0-364.el9.x86_64_1.o",
"falco_centos_5.14.0-362.el9.x86_64_1.ko",
"falco_centos_5.14.0-362.el9.x86_64_1.o",
},
expectedBucketObjects: []string{
"falco_centos_5.14.0-361.el9.x86_64_1.ko",
"falco_centos_5.14.0-361.el9.x86_64_1.o",
"falco_centos_5.14.0-362.el9.x86_64_1.ko",
"falco_centos_5.14.0-362.el9.x86_64_1.o",
},
shouldCreate: false, // since it is not publishing
name: "build 5.0.1+driver centos 5.14.0-354.el9.x86_64",
name: "build 5.0.1+driver centos 5.14.0-364.el9.x86_64",
},
{
opts: Options{
Expand All @@ -98,7 +98,7 @@ func TestBuild(t *testing.T) {
RepoRoot: "./test",
Target: root.Target{
Distro: "centos",
KernelRelease: "5.14.0-361.el9.x86_64", // try to rebuild same object.
KernelRelease: "5.14.0-362.el9.x86_64", // try to rebuild same object.
KernelVersion: "1",
},
},
Expand All @@ -107,17 +107,17 @@ func TestBuild(t *testing.T) {
IgnoreErrors: false,
},
expectedLocalObjects: []string{
"falco_centos_5.14.0-354.el9.x86_64_1.ko",
"falco_centos_5.14.0-354.el9.x86_64_1.o",
"falco_centos_5.14.0-361.el9.x86_64_1.ko",
"falco_centos_5.14.0-361.el9.x86_64_1.o",
"falco_centos_5.14.0-364.el9.x86_64_1.ko",
"falco_centos_5.14.0-364.el9.x86_64_1.o",
"falco_centos_5.14.0-362.el9.x86_64_1.ko",
"falco_centos_5.14.0-362.el9.x86_64_1.o",
},
expectedBucketObjects: []string{
"falco_centos_5.14.0-361.el9.x86_64_1.ko",
"falco_centos_5.14.0-361.el9.x86_64_1.o",
"falco_centos_5.14.0-362.el9.x86_64_1.ko",
"falco_centos_5.14.0-362.el9.x86_64_1.o",
},
shouldCreate: false, // since objects are already present, nothing should be created
name: "rebuild 5.0.1+driver centos 5.14.0-361.el9.x86_64",
name: "rebuild 5.0.1+driver centos 5.14.0-362.el9.x86_64",
},
{
opts: Options{
Expand All @@ -128,7 +128,7 @@ func TestBuild(t *testing.T) {
RepoRoot: "./test",
Target: root.Target{
Distro: "centos",
KernelRelease: "5.14.0-361.el9.x86_64", // try to rebuild same object.
KernelRelease: "5.14.0-362.el9.x86_64", // try to rebuild same object.
KernelVersion: "1",
},
},
Expand All @@ -137,17 +137,17 @@ func TestBuild(t *testing.T) {
IgnoreErrors: false,
},
expectedLocalObjects: []string{
"falco_centos_5.14.0-354.el9.x86_64_1.ko",
"falco_centos_5.14.0-354.el9.x86_64_1.o",
"falco_centos_5.14.0-361.el9.x86_64_1.ko",
"falco_centos_5.14.0-361.el9.x86_64_1.o",
"falco_centos_5.14.0-364.el9.x86_64_1.ko",
"falco_centos_5.14.0-364.el9.x86_64_1.o",
"falco_centos_5.14.0-362.el9.x86_64_1.ko",
"falco_centos_5.14.0-362.el9.x86_64_1.o",
},
expectedBucketObjects: []string{
"falco_centos_5.14.0-361.el9.x86_64_1.ko",
"falco_centos_5.14.0-361.el9.x86_64_1.o",
"falco_centos_5.14.0-362.el9.x86_64_1.ko",
"falco_centos_5.14.0-362.el9.x86_64_1.o",
},
shouldCreate: true, // since objects are already present, nothing should be created
name: "rebuild 5.0.1+driver centos 5.14.0-361.el9.x86_64",
name: "rebuild 5.0.1+driver centos 5.14.0-362.el9.x86_64",
},
}

Expand Down
Loading