Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v3
Expand All @@ -217,6 +219,11 @@ jobs:
run: |
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid

- name: Install jacoco dependencies
run: |
wget https://github.com/jacoco/jacoco/releases/download/v0.8.10/jacoco-0.8.10.zip
unzip jacoco-0.8.10.zip -d jacoco

- name: Env details
run: |
uname -a
Expand Down Expand Up @@ -249,9 +256,16 @@ jobs:
mvn -q -Pdeveloper -pl developer -Ddeploydb
mvn -q -Pdeveloper -pl developer -Ddeploydb-simulator

- name: Generate jacoco-coverage.sh
run: |
echo "java -jar jacoco/lib/jacococli.jar report jacoco-it.exec \\" > jacoco-report.sh
find . | grep "target/classes" | sed 's/\/classes\//\/classes /g' | awk '{print "--classfiles", $1, "\\"}' | sort |uniq >> jacoco-report.sh
find . | grep "src/main/java" | sed 's/\/java\//\/java /g' | awk '{print "--sourcefiles", $1, "\\"}' | sort | uniq >> jacoco-report.sh
echo "--xml jacoco-coverage.xml" >> jacoco-report.sh

- name: Start CloudStack Management Server with Simulator
run: |
export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=800m -Djava.security.egd=file:/dev/urandom"
export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=800m -Djava.security.egd=file:/dev/urandom -javaagent:jacoco/lib/jacocoagent.jar=address=*,port=36320,output=tcpserver"

@yadvr yadvr Aug 3, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we can experiment this with our smoketests against actual environment and gather/publish the jacoco file separately cc @vishesh92 @borisstoyanov @vladimirpetrov @kiranchavala @DaanHoogland - so we've a unit test coverage stats and functional/marvin test coverage stats (discuss - if you think, combined is also okay?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohityadavcloud We can get the coverage from Blue Orangutan jobs. I can do that as well, but I don't have much idea about the setup as of now. So, I will need some time to look into it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would certainly like to have them separately, but nobody dies if we don't.

echo -e "\nStarting simulator"
set +e
mvn -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run 2>&1 > /tmp/jetty-log || true &
Expand All @@ -275,10 +289,20 @@ jobs:
done

echo -e "Stopping Simulator, integration tests run completed\n"
java -jar jacoco/lib/jacococli.jar dump --address localhost --port 36320 --destfile jacoco-it.exec
bash jacoco-report.sh
mvn -Dsimulator -pl client jetty:stop 2>&1
find /tmp//MarvinLogs -type f -exec echo -e "Printing marvin logs {} :\n" \; -exec cat {} \;

- name: Integration Tests Result
run: |
echo -e "Simulator CI Test Results: (only failures listed)\n"
python3 ./tools/marvin/xunit-reader.py integration-test-results/

- uses: codecov/codecov-action@v3
with:
files: jacoco-coverage.xml
fail_ci_if_error: true
flags: simulator-marvin-tests
verbose: true
name: codecov
1 change: 1 addition & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ jobs:
with:
files: ./client/target/site/jacoco-aggregate/jacoco.xml
fail_ci_if_error: true
flags: unit-tests
verbose: true
name: codecov
9 changes: 9 additions & 0 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,12 @@ jobs:
npm run build
npm run lint
npm run test:unit

- uses: codecov/codecov-action@v3
with:
working-directory: ui
files: ./coverage/lcov.info
fail_ci_if_error: true
flags: uitests
verbose: true
name: codecov
2 changes: 1 addition & 1 deletion ui/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ module.exports = {
'!**/node_modules/**',
'!<rootDir>/src/locales/*.{js, json}'
],
coverageReporters: ['html', 'text-summary']
coverageReporters: ['html', 'text-summary', 'lcov']
}