Skip to content

Instantly share code, notes, and snippets.

@scop
scop / why-not-install-tests.md
Last active Oct 24, 2020
Why not install tests?
View why-not-install-tests.md

Why not install tests?

For the majority of users, test code is just waste of space and bandwidth. For example, for Home Assistant, in the full dependency set du -hc **/tests **/test reports 82M here (2020-10-24). Granted, most users don't install the full dependency set, so they are affected to a lesser extent, and that's a smallish fraction of the total dep set size, but still.

But isn't it good to install test code so it's around as a usage example? Test code is often not good code to be used as a general use example. It is often entangled with mockery, accesses things that should not be accessed in normal use to begin with, or accesses things in a way that is not supposed to be done outside of tests, etc, or all of that.

Isn't it good to be able to run tests suites on installed setups e.g. when diagnosing problems? Yes, that would be nice. But a bunch of things makes this less practical as it would seem on the surface.

  • Test code can have dependencies that are not
View gist:2de414c6dd90db6b72b8a571814472bd
For the majority of users, test code is just waste of space and bandwidth. For example, for Home Assistant, in the full dependency set `du -hc **/tests **/test` reports 82M here (2020-10-24). Granted, most users don't install the full dependency set, so they are affected to a lesser extent, and that's a smallish fraction of the total dep set size, but still.
Proponents of test code inclusion may say it's good to have it around as a usage example. But test code is often not good code to be used as a general use example. It is often entangled with mockery, accesses things that should not be accessed in normal use to begin with, or accesses things in a way that is not supposed to be done outside of tests, etc, or all of that.
Test code can have dependencies that are not the package's runtime dependencies. When these dependencies are not installed along with the package and its real runtime dependencies (hopefully at least these are always excluded!), users must take measures to install them before they are ab
View test.txt
event: hello
data: hello1
event: hello
data: hello2
event: hello
data: hello3
View man.diff
diff --git a/completions/man b/completions/man
index e1b587d..628e43c 100644
--- a/completions/man
+++ b/completions/man
@@ -56,17 +56,10 @@ _man()
return 0
fi
- local manpath
- if [[ $OSTYPE == *@(darwin|linux|freebsd|cygwin)* ]] || _userland GNU; then
View 0001-Add-checking-for-correct-pom-file-naming.2.patch
From dea7efd630376d0d227841d20a2dfda2c1315675 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Fri, 19 Nov 2010 18:46:52 +0100
Subject: [PATCH] Add checking for correct pom file naming
---
FilesCheck.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/FilesCheck.py b/FilesCheck.py
View fix-versioned-prereq.diff
--- Pkg.py
+++ Pkg.py
@@ -403,10 +403,19 @@
current_version=d[1]
if current_version.find(':') > 0:
current_version=''.join(current_version.split(':')[1:])
- if d[2] & rpm.RPMSENSE_EQUAL != rpm.RPMSENSE_EQUAL or current_version != version:
- return 0
- else:
- return 1
View script-interpreter-only-for-exec-scripts.diff
--- FilesCheck.py
+++ FilesCheck.py
@@ -1107,7 +1107,7 @@
# ...but executed ones should
elif res or mode & 0111 != 0 or script_regex.search(f):
if res:
- if not interpreter_regex.search(res.group(1)):
+ if mode & 0111 != 0 and not interpreter_regex.search(res.group(1)):
printError(pkg, 'wrong-script-interpreter', f, '"' + res.group(1) + '"')
elif not nonexec_file and not (lib_path_regex.search(f) and f.endswith('.la')):
View CheckPkgConfig.py
# vim:sw=4:et
#---------------------------------------------------------------
# Module : rpmlint
# File : CheckPkgConfig
# Author : Stephan Kulow, Dirk Mueller
# Purpose : Check for errors in Pkgconfig files
#---------------------------------------------------------------
from Filter import *
import AbstractCheck
View add-scoring-support.2.diff
--- Config.py
+++ Config.py
@@ -126,6 +126,17 @@
else:
_filters_re = None
+_scoring={}
+
+def setBadness(s, score):
+ _scoring[s] = score
View rpmlint-lsb.patch
Index: lsbrpmlint
===================================================================
--- lsbrpmlint (révision 0)
+++ lsbrpmlint (révision 0)
@@ -0,0 +1,14 @@
+#!/bin/sh
+#---------------------------------------------------------------
+# Project : Mandriva Linux
+# Module : rpmlint
+# File : lsbrpmlint