ballerina-platform / ballerina-lang

The Ballerina Programming Language
https://ballerina.io/
Apache License 2.0
3.68k stars 751 forks source link

[Improvement]: Introduce a way to run tests in a docker container #41036

Closed azinneera closed 6 months ago

azinneera commented 1 year ago

Description

We have bal build --cloud but not bal test --cloud but to verify the package functionality in a cloud platform, we must run the tests also in a container. This applies to GraalVM verification as well. bal test --graalvm --cloud should run the tests in a container.

For this, there should be a standalone testable jar that can be run inside a container. We can check the possibility of generating a single testable jar or separate jars for each module.

Dilhasha commented 9 months ago

Following are the sub tasks for $subject.

Dilhasha commented 8 months ago

@Ramith-D-Rodrigo

Let's create a spreadsheet with all the cases we need to address

Ramith-D-Rodrigo commented 7 months ago

--graalvm --cloud=docker is supported now. Implemented using the testable fat jar while also considering the mocking features.

Added the relevant tests for the changes. --cloud flag changes are added in c2c repository. The tests added in this repo check the changes in BTestMain and the execution of testable fat jar.