Bug#928791: congress: FTBFS twice in a row: File exists: 'congress/tests/etc/keys'

2019-08-29 Thread Sven Eckelmann
Control: tag -1 + patch

Hi,

On Sat, 11 May 2019 11:34:23 +0200 Andreas Beckmann  wrote:
[...]
> congress/experimental fails to build twice in a row:
> 
> Traceback (most recent call last):
>   File 
> "/build/congress-9.0.0+dfsg1/congress/tests/api/test_datasource_model.py", 
> line 45, in setUp
> self.ds_manager.add_datasource(self.datasource)
>   File "/build/congress-9.0.0+dfsg1/congress/dse2/datasource_manager.py", 
> line 71, in add_datasource
> secret_config_fields=driver_info.get('secret', []))
>   File "/usr/lib/python3/dist-packages/tenacity/__init__.py", line 241, in 
> wrapped_f
> return self.call(f, *args, **kw)
[...]
> FileExistsError: [Errno 17] File exists: 'congress/tests/etc/keys'

Seems like the package (or the pkg utilities) currently doesn't clean up in 
the clean target. Interestingly, even dpkg-source currently fails after a 
build finished. This is caused by following extra files/directories

* Congress.tokens
* build
* */__pycache__/
* congress/tests/etc/keys

The dpkg-source configuration of this package (debian/source/options) 
currently ignores a lot of debian specific files. It would maybe make sense to 
also to ignore __pycache__ this way.

build and Congress.tokens are part of the build and can just be cleaned using 
dh_clean's debian/clean

congress/tests/etc/keys is slightly more interesting. It is part of the files 
generated by the test suite. So congress/tests/api/test_datasource_model.py's 
setUp() method could be changed to take care of this. But I am not familiar 
with this package. But to fix the FTBS "twice in a row" problem, it is enough 
to also delete the test artifact during clean.

Even when this patch is currently formatted like a NMU, it is not part of an 
actual NMU.

Kind regards,
Svendiff -Nru congress-9.0.0+dfsg1/debian/changelog congress-9.0.0+dfsg1/debian/changelog
--- congress-9.0.0+dfsg1/debian/changelog	2019-07-17 15:31:05.0 +0200
+++ congress-9.0.0+dfsg1/debian/changelog	2019-08-28 21:53:11.0 +0200
@@ -1,3 +1,12 @@
+congress (9.0.0+dfsg1-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS twice in a row (Closes: #928791).
+- Ignore __pycache__ artifacts during dpkg-source.
+- Clean build and test artifacts.
+
+ -- Sven Eckelmann   Wed, 29 Aug 2019 18:00:41 +0200
+
 congress (9.0.0+dfsg1-3) unstable; urgency=medium
 
   * Uploading to unstable.
diff -Nru congress-9.0.0+dfsg1/debian/clean congress-9.0.0+dfsg1/debian/clean
--- congress-9.0.0+dfsg1/debian/clean	1970-01-01 01:00:00.0 +0100
+++ congress-9.0.0+dfsg1/debian/clean	2019-08-28 21:38:13.0 +0200
@@ -0,0 +1,3 @@
+Congress.tokens
+build/
+congress/tests/etc/keys/
diff -Nru congress-9.0.0+dfsg1/debian/source/options congress-9.0.0+dfsg1/debian/source/options
--- congress-9.0.0+dfsg1/debian/source/options	2019-07-17 15:31:05.0 +0200
+++ congress-9.0.0+dfsg1/debian/source/options	2019-08-28 21:40:12.0 +0200
@@ -1,3 +1,4 @@
 extend-diff-ignore = "^[^/]*[.]egg-info/"
 extend-diff-ignore = "^congress/datalog/CongressParser.py"
 extend-diff-ignore = "^congress/datalog/CongressLexer.py"
+extend-diff-ignore = "/__pycache__/"


signature.asc
Description: This is a digitally signed message part.


Bug#928791: congress: FTBFS twice in a row: File exists: 'congress/tests/etc/keys'

2019-05-11 Thread Andreas Beckmann
Source: congress
Version: 9.0.0+dfsg1-2
Severity: serious
Tags: ftbfs
Justification: fails to build from source

Hi,

congress/experimental fails to build twice in a row:

Traceback (most recent call last):
  File 
"/build/congress-9.0.0+dfsg1/congress/tests/api/test_datasource_model.py", line 
45, in setUp
self.ds_manager.add_datasource(self.datasource)
  File "/build/congress-9.0.0+dfsg1/congress/dse2/datasource_manager.py", line 
71, in add_datasource
secret_config_fields=driver_info.get('secret', []))
  File "/usr/lib/python3/dist-packages/tenacity/__init__.py", line 241, in 
wrapped_f
return self.call(f, *args, **kw)
  File "/usr/lib/python3/dist-packages/tenacity/__init__.py", line 330, in call
start_time=start_time)
  File "/usr/lib/python3/dist-packages/tenacity/__init__.py", line 279, in iter
return fut.result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in 
__get_result
raise self._exception
  File "/usr/lib/python3/dist-packages/tenacity/__init__.py", line 333, in call
result = fn(*args, **kwargs)
  File "/build/congress-9.0.0+dfsg1/congress/db/utils.py", line 42, in decorate
return func(*args, **kw)
  File "/build/congress-9.0.0+dfsg1/congress/db/datasources.py", line 94, in 
add_datasource
_encrypt_secret_config_fields(datasource, secret_config_fields)
  File "/build/congress-9.0.0+dfsg1/congress/db/datasources.py", line 60, in 
_encrypt_secret_config_fields
config[field] = encryption.encrypt(config[field])
  File "/build/congress-9.0.0+dfsg1/congress/encryption.py", line 85, in encrypt
initialize_if_needed()
  File "/build/congress-9.0.0+dfsg1/congress/encryption.py", line 81, in 
initialize_if_needed
initialize_key()
  File "/build/congress-9.0.0+dfsg1/congress/encryption.py", line 72, in 
initialize_key
__key = create_new_key_file()
  File "/build/congress-9.0.0+dfsg1/congress/encryption.py", line 52, in 
create_new_key_file
os.makedirs(dir_path, mode=0o700)  # important: restrictive permissions
  File "/usr/lib/python3.7/os.py", line 221, in makedirs
mkdir(name, mode)
FileExistsError: [Errno 17] File exists: 'congress/tests/etc/keys'


--
Ran 832 tests in 75.262s

FAILED (failures=2, skipped=5)
make[1]: *** [debian/rules:41: override_dh_install] Error 1


Andreas


congress_9.0.0+dfsg1-2_twice.log.gz
Description: application/gzip