Skip to content

Fix bundle renderer tests on local machine#123

Merged
SimonBaeumer merged 1 commit intomasterfrom
fix-test-locally
Dec 16, 2021
Merged

Fix bundle renderer tests on local machine#123
SimonBaeumer merged 1 commit intomasterfrom
fix-test-locally

Conversation

@SimonBaeumer
Copy link
Copy Markdown
Contributor

@SimonBaeumer SimonBaeumer commented Dec 15, 2021

Description

Due to side effects on setting the versions and buildtimestamps without restoring old versions this test passed in CI but never locally.
Created ROX-8768 for adding a restorer to the version.

Checklist

  • Investigated and inspected CI test results
  • Unit test and regression tests added
  • Evaluated and added CHANGELOG entry if required
  • Determined and documented upgrade steps

If any of these don't apply, please comment below.

Testing Performed

  • Run test locally and in CI

@ghost
Copy link
Copy Markdown

ghost commented Dec 15, 2021

Tag for build #30274 is 3.67.x-158-g2c8200cf07.

💻 For deploying this image using the dev scripts, run the following first:

export MAIN_IMAGE_TAG='3.67.x-158-g2c8200cf07'

📦 You can also generate an installation bundle with:

docker run -i --rm stackrox/main:3.67.x-158-g2c8200cf07 central generate interactive > bundle.zip

🕹️ A roxctl binary artifact can be downloaded from CircleCI.

@SimonBaeumer SimonBaeumer changed the title Fix bundle renderer tests locally Fix bundle renderer tests on local machine Dec 15, 2021
Copy link
Copy Markdown
Contributor

@porridge porridge left a comment

Choose a reason for hiding this comment

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

I still don't understand why this "test passed in CI but never locally"? Is it somehow related to the TEST_VERSIONS env var?

@SimonBaeumer
Copy link
Copy Markdown
Contributor Author

SimonBaeumer commented Dec 16, 2021

I still don't understand why this "test passed in CI but never locally"? Is it somehow related to the TEST_VERSIONS env var?

The test failed because the build timestamp and versions were not set. These are normally set at build time via ld-flags and are saved into global variables.
The problem problem arises if another test set the build timestamp or version first, in that case it has side-effects because these values were never reverted.
In CI this success but can lead to flaky tests, depending whether another test set the versions and timestamps before or not.

@SimonBaeumer SimonBaeumer merged commit ecb7495 into master Dec 16, 2021
@SimonBaeumer SimonBaeumer deleted the fix-test-locally branch December 16, 2021 07:46
@porridge
Copy link
Copy Markdown
Contributor

The test failed because the build timestamp and versions were not set.

Right, but what I'm missing is why they were set in CI (where you say this test passes) but not locally (where you say it fails), @SimonBaeumer ?

@SimonBaeumer
Copy link
Copy Markdown
Contributor Author

The test failed because the build timestamp and versions were not set.

Right, but what I'm missing is why they were set in CI (where you say this test passes) but not locally (where you say it fails), @SimonBaeumer ?

@porridge they were set in a test which run previous to these tests which lead to this side effect.

@porridge
Copy link
Copy Markdown
Contributor

Ah, so the difference is that locally you were running just a single test, while in CI the side effects of other tests made it succeed?

RTann pushed a commit that referenced this pull request Apr 6, 2022
janisz added a commit that referenced this pull request Apr 8, 2026
Simplified approach:
1. Generate report with Slack-format links directly in audit script
   - `[#123](url)` → `<url|#123>`
   - No conversion needed in posting script

2. Post as single message instead of multiple sections
   - Simpler code, easier to read in Slack
   - All content in one place with scroll

3. Removed awk link conversion logic
   - Not needed since report has Slack links natively
   - Simplified build_full_message to just concatenate content

Changes:
- audit-backport-prs.sh: Generate <url|text> format instead of [text](url)
- post-backport-audit-to-slack.sh: Remove link conversion, post single message

Partially generated with AI assistance.
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.

2 participants