podman-tui icon indicating copy to clipboard operation
podman-tui copied to clipboard

test failing if the user's home directory is not at `/home/$USER`

Open yurkobb opened this issue 3 years ago • 0 comments

Describe the bug Trying to update the nixos package I'm hitting an error during test phase:

=== RUN   TestUtils
Running Suite: UI Utils Suite - /build/source/ui/utils
======================================================
Random Seed: 1665045212

Will run 10 of 10 specs
••
------------------------------
• [FAILED] [0.000 seconds]
utils
github.com/containers/podman-tui/ui/utils/utils_test.go:12
  [It] resolve home directory
  github.com/containers/podman-tui/ui/utils/utils_test.go:33

  Expected
      <string>: /homeless-shelter/path02
  to equal
      <string>: /home/nixbld/path02
  In [It] at: github.com/containers/podman-tui/ui/utils/utils_test.go:50
------------------------------
•••••••


Summarizing 1 Failure:
  [FAIL] utils [It] resolve home directory
  github.com/containers/podman-tui/ui/utils/utils_test.go:50

Ran 10 of 10 Specs in 0.001 seconds
FAIL! -- 9 Passed | 1 Failed | 0 Pending | 0 Skipped
--- FAIL: TestUtils (0.00s)
FAIL
FAIL    github.com/containers/podman-tui/ui/utils       0.009s
FAIL
error: builder for '/nix/store/3dpvwc0yiybf0mn1cr1xiif0yvd61dzc-podman-tui-0.6.0.drv' failed with exit code 1;
       last 10 log lines:
       > Summarizing 1 Failure:
       >   [FAIL] utils [It] resolve home directory
       >   github.com/containers/podman-tui/ui/utils/utils_test.go:50
       >
       > Ran 10 of 10 Specs in 0.001 seconds
       > FAIL! -- 9 Passed | 1 Failed | 0 Pending | 0 Skipped
       > --- FAIL: TestUtils (0.00s)
       > FAIL
       > FAIL github.com/containers/podman-tui/ui/utils       0.009s
       > FAIL
       For full logs, run 'nix log /nix/store/3dpvwc0yiybf0mn1cr1xiif0yvd61dzc-podman-tui-0.6.0.drv'.

To Reproduce Run tests in an environment where the current user's $HOME is not at /home/$USER.

Expected behavior The test should not assume the home directory to always be at /home/$USER.

Desktop (please complete the following information):

  • OS: nixos 22.05
  • Podman Version: irrelevant
  • Podman TUI version: 0.6.0

yurkobb avatar Oct 06 '22 08:10 yurkobb