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

Conflict with expected output and prefix replacment when --prefix is /usr #1345

Open
carnil opened this issue Nov 24, 2024 · 1 comment · May be fixed by #1346
Open

Conflict with expected output and prefix replacment when --prefix is /usr #1345

carnil opened this issue Nov 24, 2024 · 1 comment · May be fixed by #1346
Labels

Comments

@carnil
Copy link
Contributor

carnil commented Nov 24, 2024

Hi

While preparing the Debian package for the new upstream version 0.12.3 I noticed that the test_cmds.sh testcase fails now.

======================================
   lnav 0.12.3: test/test-suite.log
======================================

# TOTAL: 39
# PASS:  38
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test_cmds.sh
==================
[...]
END   test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out
OUT: test: ../src/lnav-test -n -c :switch-to-view help {test_dir}/logfile_access_log.0
--- /home/carnil/lnav/lnav-0.12.3/test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out       2024-1
1-20 05:11:07.000000000 +0000
+++ test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out   2024-11-24 13:23:55.817819636 +0000
@@ -78,7 +78,7 @@
 to write scripts for processing logs with lnav. For example, to get a
 list of IP addresses that dhclient has bound to in CSV format:
 
- ▌#! /usr/bin/lnav -nf                                                                            
+ ▌#! {prefix}/bin/lnav -nf                                                                            
  ▌                                                                                                
  ▌# Usage: dhcp_ip.lnav /var/log/messages                                                         
  ▌# Only include lines that look like:                                                            
FAIL! EXPECTED OUT DIFF
BEGIN test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.err
END   test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.err

The problem happens since 697f256 and 7ee9715 adds replacmenet of -e "s;${prefix};{prefix};g" \. so we end in the TESTS_ENVIRONMENT sanitizing/generalizing too much and replacing the /usr in the help text output as well.

@carnil carnil added the bug label Nov 24, 2024
@carnil
Copy link
Contributor Author

carnil commented Nov 24, 2024

I guess we need to replace similar to as the fixups in 697f256

carnil added a commit to carnil/lnav that referenced this issue Nov 24, 2024
Commit 697f256 ("[tests] sub some more variables in expected
output") introduced new replacements for ${prefix} occurences. In case
where prefix is /usr the TESTS_ENVIRONMENT will additionally replace the
occurence of

	#! /usr/bin/lnav -nf

with a

	#! {prefix}/bin/lnav -nf

and causing the test_cmds.sh to fail.

Fixes: 697f256 ("[tests] sub some more variables in expected output")
Fixes: tstack#1345
Signed-off-by: Salvatore Bonaccorso <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant