Azure platform: fix getting the console output #113
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix getting the console output
The regex patterns to process the URL were assuming that the test names would all start with "kola-", which is not true when running Jenkins tests. This caused the container and blobName variables to be empty, making it impossible to get the console output.
On top of this, the function that reads the data was always returning an error, which meant that the data was never written, even if it could be obtained successfully.
This change fixes the regex patterns, adds a lot more error handling, and returns non-error when the function succeeds
How to use / Testing done
bin/kola run --parallel=1 --basename=marga-test --board=amd64-usr --channel=beta --platform=azure '--azure-blob-url=https://flatcar.blob.core.windows.net/publish/flatcar-linux-2512.1.1-beta.vhd?se=2099-12-31T23%3A59%3A59Z&sig=FAiqfI5MVw7b11kNc%2Bfb7OMQjphiUHuLnMEzNhOHh9g%3D&sp=rl&sr=b&sv=2015-02-21' --azure-location=francecentral --azure-profile=~/.creds/azureProfile.json --azure-auth=~/.creds/azureCredentials.json --tapfile=azure.tap --torcx-manifest=torcx_manifest.json kubernetes.kubelet_wrapper.var-log-mount
Before this change, this would print errors and not generate any console output files. With this change, running this test will end up generating a console.txt file, like this one:
_kola_temp/azure-2020-06-17-1544-8943/kubernetes.kubelet_wrapper.var-log-mount/marga-test-fb-b811232835/console.txt
Fixes: kinvolk/PROJECT-flatcar-linux#284