The screen capture tests were failing on my machine because the screen capture based vttest tests were using my personal config in ~/.config/aminal/config.toml. This had different colours and a fixed
DPI scaling factor which mean the screen captures didn't match.
The sixel tests were also failing because my login shell is a customised zsh.
A static test config is now passed by the vttest tests and the shell is set to "/bin/sh" on Linux, OSX etc to help avoid problems due to differences between shells and shell configs.
This PR also includes a change which makes DefaultConfig a little safer. Instead of having a global mutable DefaultConfig which might be changed by anything during run/test time turn DefaultConfig into a function which returns a fresh DefaultConfig. This is safer and more convenient.
Type of change
Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
xvfb-run --server-args="-screen 0 1024x768x24" make test now works reliably on my test machines when it didn't before.
Test Configuration:
OS: Linux
OS version: Ubuntu 18.04
Go version: 1.11.5
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules
Description
The screen capture tests were failing on my machine because the screen capture based vttest tests were using my personal config in ~/.config/aminal/config.toml. This had different colours and a fixed DPI scaling factor which mean the screen captures didn't match.
The sixel tests were also failing because my login shell is a customised zsh.
A static test config is now passed by the vttest tests and the shell is set to "/bin/sh" on Linux, OSX etc to help avoid problems due to differences between shells and shell configs.
This PR also includes a change which makes DefaultConfig a little safer. Instead of having a global mutable DefaultConfig which might be changed by anything during run/test time turn DefaultConfig into a function which returns a fresh DefaultConfig. This is safer and more convenient.
Type of change
How Has This Been Tested?
xvfb-run --server-args="-screen 0 1024x768x24" make test
now works reliably on my test machines when it didn't before.Test Configuration:
Checklist: