mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Generate coverage for Simulator based integration tests & ui tests in github actions (#7784)
* Generate coverage for Simulator based integration tests * Add flag for unit tests * Add coverage for uitests
This commit is contained in:
parent
c4e53c0095
commit
3ec3007635
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
@ -193,6 +193,8 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
@ -217,6 +219,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid
|
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
|
- name: Env details
|
||||||
run: |
|
run: |
|
||||||
uname -a
|
uname -a
|
||||||
@ -249,9 +256,16 @@ jobs:
|
|||||||
mvn -q -Pdeveloper -pl developer -Ddeploydb
|
mvn -q -Pdeveloper -pl developer -Ddeploydb
|
||||||
mvn -q -Pdeveloper -pl developer -Ddeploydb-simulator
|
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
|
- name: Start CloudStack Management Server with Simulator
|
||||||
run: |
|
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"
|
||||||
echo -e "\nStarting simulator"
|
echo -e "\nStarting simulator"
|
||||||
set +e
|
set +e
|
||||||
mvn -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run 2>&1 > /tmp/jetty-log || true &
|
mvn -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run 2>&1 > /tmp/jetty-log || true &
|
||||||
@ -275,6 +289,8 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo -e "Stopping Simulator, integration tests run completed\n"
|
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
|
mvn -Dsimulator -pl client jetty:stop 2>&1
|
||||||
find /tmp//MarvinLogs -type f -exec echo -e "Printing marvin logs {} :\n" \; -exec cat {} \;
|
find /tmp//MarvinLogs -type f -exec echo -e "Printing marvin logs {} :\n" \; -exec cat {} \;
|
||||||
|
|
||||||
@ -282,3 +298,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo -e "Simulator CI Test Results: (only failures listed)\n"
|
echo -e "Simulator CI Test Results: (only failures listed)\n"
|
||||||
python3 ./tools/marvin/xunit-reader.py integration-test-results/
|
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
.github/workflows/codecov.yml
vendored
1
.github/workflows/codecov.yml
vendored
@ -53,5 +53,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
files: ./client/target/site/jacoco-aggregate/jacoco.xml
|
files: ./client/target/site/jacoco-aggregate/jacoco.xml
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
|
flags: unit-tests
|
||||||
verbose: true
|
verbose: true
|
||||||
name: codecov
|
name: codecov
|
||||||
|
|||||||
9
.github/workflows/ui.yml
vendored
9
.github/workflows/ui.yml
vendored
@ -51,3 +51,12 @@ jobs:
|
|||||||
npm run build
|
npm run build
|
||||||
npm run lint
|
npm run lint
|
||||||
npm run test:unit
|
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
|
||||||
|
|||||||
@ -50,5 +50,5 @@ module.exports = {
|
|||||||
'!**/node_modules/**',
|
'!**/node_modules/**',
|
||||||
'!<rootDir>/src/locales/*.{js, json}'
|
'!<rootDir>/src/locales/*.{js, json}'
|
||||||
],
|
],
|
||||||
coverageReporters: ['html', 'text-summary']
|
coverageReporters: ['html', 'text-summary', 'lcov']
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user