eclipse-edc / Connector

EDC core services including data plane and control plane
Apache License 2.0
288 stars 240 forks source link

Integration-Tests: replace external systems with self-contained systems #360

Closed paullatzelsperger closed 2 years ago

paullatzelsperger commented 2 years ago

Integration tests should use self-contained systems (e.g. in a docker container) rather than actual cloud infrastructure. At the moment we have tests running against Azure CosmosDB and AWS S3. The following solutions should be looked into:

Lets make sure we're not violating any licenses etc. in the process :)

Linked to #246

377 contributes

Note: we want to create an E2E-Enviroment, where we actually deploy connector instances in the cloud, which could then indeed use the "real" cloud backends again. That is more of a long-term goal though.

algattik commented 2 years ago

Also Azurite for Azure storage

paullatzelsperger commented 2 years ago

has anyone ever actually used Azure CosmosDB Emulator in a Github Action? My problem is the following:

this guide instructs to export the certificate from the emulator. Since the certificate is different for every running container, we cannot check it in to VCS.

When I try to obtain the cert from localhost:8081 using the curl command, I get a OpenSSL SSL_connect: SSL_ERROR_SYSCALL error, but I cannot use the $ipaddr override, because environment variables for services cannot be set through bash commands.

When I try to just curl using $ipaddr (without setting the AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE) I get a connection-refused error.

I guess, what I'm asking is: has anyone a working Github Actions workflow I could "borrow" :)?

paullatzelsperger commented 2 years ago

Quick update: I was able to fix the connection error, turns out there needs to be a wait loop, since the docker image for CosmosDB does not have a health command. Next issue is related to Java Keystores though.

paullatzelsperger commented 2 years ago

Here's my thoughts about replacing a Azure-based CosmosDB with the Emulator for testing. Pros:

Cons:

After a whole day spent with this topic, I think we should continue using the Azure-based CosmosDB. The Emulator seems not to be geared toward CI/CD, it's not easily integratable and will cause us headaches due to random failures. I therefore recommend skipping CosmosDB for this issue!

ndr-brt commented 2 years ago

Since #721 I think the cosmos db thing could be accomplished with some investigations. Will re-open this.

ndr-brt commented 2 years ago

I think this needs to stay open until we're able to run cosmos db tests in github actions. @algattik are you on this?

algattik commented 2 years ago

Yes I have something working already, will raise PR soon