#981717 command-not-found: test 'multi advise debs' broken

Package:
command-not-found
Source:
command-not-found
Submitter:
Ritesh Raj Sarraf
Date:
2021-02-03 09:27:03 UTC
Severity:
normal
Tags:
#981717#5
Date:
2021-02-03 08:14:27 UTC
From:
To:
The package reportedly fails in one of the tests. The failing test log
snippet is below:

```
FAIL: test_from_table (CommandNotFound.tests.test_command_not_found.CommandNotFoundOutputTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/command-not-found-20.10.1/CommandNotFound/tests/test_command_not_found.py", line 149, in test_from_table
    self._test_spec(spec)
  File "/build/command-not-found-20.10.1/CommandNotFound/tests/test_command_not_found.py", line 191, in _test_spec
    self.assertEqual(output, expected_output, "test '%s' broken" % test)
AssertionError: "Comm[87 chars]0, or (You will have to enable component calle[97 chars]')\n" != "Comm[87 chars]0, or\nsudo apt install neovim  # version 2.0\n"
  Command 'x-vi' not found, but can be installed with:
- sudo apt install vim     # version 1.0, or (You will have to enable component called 'main')
- sudo apt install neovim  # version 2.0 (You will have to enable component called 'main')
+ sudo apt install vim     # version 1.0, or
+ sudo apt install neovim  # version 2.0
 : test 'multi advise debs' broken
----------------------------------------------------------------------
Ran 12 tests in 0.571s

FAILED (failures=1)
```

Full build log is available at:
https://tests.reproducible-builds.org/debian/rb-pkg/bullseye/amd64/command-not-found.html

#981717#10
Date:
2021-02-03 09:04:57 UTC
From:
To:
Control: tag -1 moreinfo
Control: severity -1 normal

It builds for me and builds on the buildds, so meh, this is not release
critical.

Why does reproducible build builders build without main in their
sources.list? This does not seem to make a lot of sense.

Sure, you can argue that the tests should not depend on main being
enabled in your hosts sources.list, but in practice this is not
something that should fail.

#981717#19
Date:
2021-02-03 09:24:54 UTC
From:
To:
Yes. Indeed. For any build environment where the repositories are set
proper, it does build. I verified it in my debspawn build environment
and it builds proper.

Not just reproducible builds but many others too. Gitlab runners, Open
Build Service, Reproducible Builds and probably many more.

Any environment which is, on-the-fly created from scratch, doesn't have
the repository information.

I just checked on my machine and no package claims ownership of
`/etc/apt/sources.list`.

If you really have the dependency on that data, it would be better to
check and generate one, if not available.

The assumption that the repository information is available at hand in
all the build environment is certainly not correct.