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(pam/integration-tests): Use absolute paths for compiling and reference external files #274

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

Conversation

3v1n0
Copy link
Collaborator

@3v1n0 3v1n0 commented Mar 26, 2024

PAM integration tests highly depend on C code and sometimes we need to debug them using the good old gdb or address sanitizer. This implies using go test -c to generate the binaries to inspect with the proper debug symbols.

At the current state to be able to run the tests from the generated binary, we need to chdir inside the integration-tests folder, but this is a bit annoying.

So basically this change allows to just do go test -C ./pam/integration-tests -c and gdb --args ./pam/integration-tests/integration-tests.test -test.run TestCLI. Tiny change but it makes my life happier :).

Since we're building the test files for local usage only, it's seems fine to use absolute paths to refer to any asset they build or require.

@3v1n0 3v1n0 requested a review from a team as a code owner March 26, 2024 19:23
@denisonbarbosa
Copy link
Member

Needs a rebase on main

Copy link
Member

@denisonbarbosa denisonbarbosa left a comment

Choose a reason for hiding this comment

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

Instead of changing this so promptly, can you please take a closer look at what the WithGoldenPath function does and understand why having to specify the directory for the LoadWithUpdateFromGolden is not a good thing?

@3v1n0
Copy link
Collaborator Author

3v1n0 commented Apr 4, 2024

Instead of changing this so promptly, can you please take a closer look at what the WithGoldenPath function does and understand why having to specify the directory for the LoadWithUpdateFromGolden is not a good thing?

I had checked that, but the problem here was the one I mentioned, so being able to run the built test files from anywhere they are, I'm open to other solutions though

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