codex-storage / cs-codex-dist-tests

Distributed System Tests for Nim-Codex
4 stars 4 forks source link

Option to set an unique k8sNamespacePrefix per tests run #9

Closed veaceslavdoina closed 1 year ago

veaceslavdoina commented 1 year ago

In the app config we have a key https://github.com/codex-storage/cs-codex-dist-tests/blob/1b490c475e48fca995801b55fa59cd93a6151bdd/DistTestCore/Configuration.cs#L10

which defines a namespace prefix and pods will run in the following namespaces

ct-00001
ct-00002
ct-00003
ct-...

It works well when we run tests once, but the next run will overlap with the precedent one and will clean all previous objects. And, that approach is undesired.

We should be able to set an unique prefix per run

k8sNamespacePrefix: "ct-%id%-", 

It can be a short random string ct-ief0xeix- or maybe a date with a seconds precision, like ct-20230529-112909- or anything else unique.

veaceslavdoina commented 1 year ago

We may consider to use that unique ID in a more global way and name it like a RUN_ID

  1. We will add it to the Job name and label and variable, than we should be able to filter logs in Kibana by that RUN_ID and use it for App
  2. App will be able to use RUN_ID in namespace name - k8sNamespacePrefix: "ct-%RUN_ID%-",
veaceslavdoina commented 1 year ago

In 303eb99f490dd1e2c167f8284e01fc12feee2ba3 we use a random as a namespace suffix GUID.