Page MenuHomeFreeBSD

sysutils/node_exporter: Add license file, tests, docs and examples
ClosedPublic

Authored by 0mp on Jan 9 2019, 3:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 8 2024, 11:20 PM
Unknown Object (File)
Dec 30 2023, 4:38 AM
Unknown Object (File)
Dec 30 2023, 4:38 AM
Unknown Object (File)
Dec 30 2023, 4:38 AM
Unknown Object (File)
Dec 30 2023, 4:38 AM
Unknown Object (File)
Dec 27 2023, 4:55 AM
Unknown Object (File)
Dec 23 2023, 12:17 AM
Unknown Object (File)
Dec 19 2023, 7:29 AM

Details

Summary
sysutils/node_exporter: Add tests, docs and examples

- Define LICENSE_FILE.
- Sort variables.
- Add a do-test target and prepare a testing environment.  One test is skipped
  at the moment due to a problem with detecting procfs(5) on FreeBSD.
- Install documentation and examples.
- Change pkg-descr to better match upstream's README.

I am not sure about a couple of things, however:

  • Is it fine to use USES=gmake instead of TEST_DEPENDS=gmake:devel/gmake? USES=gmake adds a dependency to the build process, which is not ideal.
  • The whole pre-test target is rather hacky. I was unable to come up with a prettier solution though. Go is a little bit hard to tame.

Bugzilla: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234791

Test Plan
  • portlint
  • poudriere testport:
    • 11.2 & 12.0 on amd64 & i386

In order to try out the test suite:

sh
echo "cd /usr/ports/sysutils/node_exporter/ && make test" | poudriere bulk -j 120i -i sysutils/node_exporter shells/bash textproc/gsed net-mgmt/prometheus2

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

0mp edited the summary of this revision. (Show Details)

This looks pretty great. I had been wondering about this recently for the prometheus2 port :)

mat requested changes to this revision.Jan 22 2019, 3:07 PM
mat added inline comments.
sysutils/node_exporter/Makefile
25โ€“28 โ†—(On Diff #52695)

This does not do what you think it does.

First, shebangs are handled during the patch phase, so this would not do anything.

Second, target(x) checks for the existence of the target, and when make is at this point, parsing the Makefile, the do-test target does not exist.

Given the footprint of shebangfix, doing it always is ok.

This revision now requires changes to proceed.Jan 22 2019, 3:07 PM
  • Set USES=shebang unconditionally as it has little performance footprint.
This revision is now accepted and ready to land.Jan 24 2019, 2:52 PM
This revision was automatically updated to reflect the committed changes.