build-system
build-system copied to clipboard
Test integration between packages_exporter and albs-sign-file
Currently, the albs-sign-file service is being used as part of the packages exporter process to sign repomd.xml
file and produce the repomd.xml.asc
file in the exported repo.
When albs-sign-file was introduced for that purpose, we found out that testing such sign process is not that easy as it could look at first. For this reason, we ended up deciding to skip such test for now and then, think about a way to bring a working albs-sign-file instance into the mix to perform these integration tests. Some thoughts about it:
We need to bring up a configured sign_file instance when setting up the test environment. This is, prepare everything to run: docker compose run --no-deps web_server db sign_file ...
The sign_file service should:
- Have a user inside db
- A key in gpg database
Also, there is no point in getting the sign_keys from web_server as we haven't loaded any keys into testing db. We should load sign keys into db to request keys from web_server if we want this test to work that way, which can be easily achieved with fixture.
In any case, I propose to, simply, pass the key_id of the key(s) that we add into sign_file service when setting up the test environment and skip the call to exporter.get_sign_keys
, which can be tested elsewhere.
Take into account that the exporter should know the sign_file user credentials as they are used to request a token from the sign_file service.