galasa-dev / projectmanagement

Project Management repo for Issues and ZenHub
7 stars 3 forks source link

Running tests on a fresh ecosystem fails with a CouchDB 401 #1886

Closed eamansour closed 4 weeks ago

eamansour commented 1 month ago

Describe the bug

When running helm test to validate the installation of an ecosystem using the Helm chart, the validation pod errors with:

9/05/2024 14:59:44.661 ERROR dev.galasa.boot.Launcher.launch - Unable to run test class
dev.galasa.boot.LauncherException: dev.galasa.framework.spi.FrameworkException: Validation failed of database galasa_run - HTTP/1.1 401 Unauthorized
    at dev.galasa.boot.felix.FelixFramework.runValidateEcosystem(FelixFramework.java:664)
    at dev.galasa.boot.Launcher.launch(Launcher.java:200)
    at dev.galasa.boot.Launcher.main(Launcher.java:126)
Caused by: dev.galasa.framework.spi.FrameworkException: Validation failed of database galasa_run - HTTP/1.1 401 Unauthorized
    at dev.galasa.framework.ValidateEcosystem.setup(ValidateEcosystem.java:42)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at dev.galasa.boot.felix.FelixFramework.runValidateEcosystem(FelixFramework.java:662)
    ... 2 more
Caused by: dev.galasa.ras.couchdb.internal.CouchdbRasException: Validation failed of database galasa_run - HTTP/1.1 401 Unauthorized
    at dev.galasa.ras.couchdb.internal.CouchdbValidatorImpl.checkDatabasePresent(CouchdbValidatorImpl.java:96)
    at dev.galasa.ras.couchdb.internal.CouchdbValidatorImpl.checkCouchdbDatabaseIsValid(CouchdbValidatorImpl.java:62)
    at dev.galasa.ras.couchdb.internal.CouchdbRasStore.<init>(CouchdbRasStore.java:96)
    at dev.galasa.ras.couchdb.internal.CouchdbRasStore.<init>(CouchdbRasStore.java:81)
    at dev.galasa.ras.couchdb.internal.CouchdbRasRegistration.initialise(CouchdbRasRegistration.java:52)
    at dev.galasa.framework.FrameworkInitialisation.initialiseResultsArchiveStore(FrameworkInitialisation.java:700)
    at dev.galasa.framework.FrameworkInitialisation.<init>(FrameworkInitialisation.java:196)
    at dev.galasa.framework.FrameworkInitialisation.<init>(FrameworkInitialisation.java:43)
    at dev.galasa.framework.ValidateEcosystem.setup(ValidateEcosystem.java:40)
    ... 7 more

This is likely because the GALASA_RAS_TOKEN env variable isn't passed in to the validation job.

However, even when passing it in, the test pod starts and fails with the same error. This means that tests also aren't able to run on freshly-installed ecosystems.

Steps to reproduce

  1. Follow the instructions to install the ecosystem Helm chart on minikube
  2. Run helm test <release-name>
  3. The validation pod should error out

Expected behavior

The validation job should not error out and tests should be able to run on the ecosystem.