Skip to content

Commit a24afa6

Browse files
Enable codacy code style check (#320)
Enable Codacy code style check and code coverage. Add report_coverage job in Travis build. Add Codacy badge.
1 parent 8253df9 commit a24afa6

File tree

4 files changed

+56
-43
lines changed

4 files changed

+56
-43
lines changed

.codacy.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
exclude_paths:
2+
- '.bundle/**'
3+
- 'spec/**/*'
4+
- 'benchmarks/**/*'
5+
- '*.min.js'
6+
- '**/tests/**'
7+
- '**/functionaltests/**/*'
8+
- 'wiki/**'
9+
- '.github/**'
10+
- 'CODE_OF_CONDUCT.md'
11+
- 'CONTRIBUTING.md'

.travis.yml

+22-29
Original file line numberDiff line numberDiff line change
@@ -19,54 +19,47 @@ before_install:
1919
- uname -a
2020
- chmod +x pom.xml
2121

22-
23-
# This is only run before integrationTests job
24-
# To ensure docker containers are fully up and running we sleep 60s
25-
before_script:
26-
- source src/main/docker/env.bash
27-
- docker-compose -f src/main/docker/docker-compose.yml up -d mongodb rabbitmq eiffel-er jenkins mail-server
28-
- sleep 60
29-
30-
31-
# Generate site documentation using mvn site plugin
32-
before_deploy:
33-
- rm -rf docs
34-
- mvn site -B
35-
36-
37-
# Using default stage 'test' for all our test jobs, and only running deploy stage
38-
# (after merge) to master branch
22+
# Only running report_coverage and deploy stage (after merge) to master branch
3923
stages:
4024
- test
25+
- name: report_coverage
26+
if: branch = master AND type != pull_request
4127
- name: deploy
42-
if: branch = master
43-
28+
if: branch = master AND type != pull_request
4429

4530
# List of jobs to run, tied to specific stages
4631
jobs:
4732
include:
4833
- stage: test
49-
name: functionalTests
50-
before_script: skip
34+
name: unitAndFunctionalTests
5135
script:
52-
# We will run one test using embedded mongodb first that will download the mongo instance and
53-
# then the rest of the test that will no longer need to download the embedded mongo since it will exist.
54-
#
55-
# Also important that the first test to be run is a Spring Boot Test since spring boot also downloads
56-
# another version of embedded mongo db to avoid race conditions between Spring Boot tests
57-
- mvn -Dsurefire.rerunFailingTestsCount=2 -DsomeModule.test.includes="**/QueryServiceTest.java" test -DskipITs -B
58-
- mvn -Dsurefire.rerunFailingTestsCount=2 -DsomeModule.test.excludes="**/QueryServiceTest.java" test -DskipITs -B
36+
- mvn -Dsurefire.rerunFailingTestsCount=2 test -DskipITs -B
5937
- stage: test
6038
name: integrationTests
39+
# To ensure docker containers are fully up and running we sleep 60s
40+
before_script:
41+
- source src/main/docker/env.bash
42+
- docker-compose -f src/main/docker/docker-compose.yml up -d mongodb rabbitmq eiffel-er jenkins mail-server
43+
- sleep 60
6144
script:
6245
- mvn verify -DskipUTs -Der.url=http://localhost:8084/search/ -Drabbitmq.exchange.name=ei-exchange -Dspring.mail.host=localhost -Dspring.mail.port=1025 -Dwaitlist.fixedRateResend=1 -B
6346
- stage: deploy
6447
name: deployGitHubPages
65-
before_script: skip # do not run this on deploy
6648
script: skip # do not run default test scripts
6749
install: skip # do not run default mvn install
50+
# Generate site documentation using mvn site plugin
51+
before_deploy:
52+
- rm -rf docs
53+
- mvn site -B
6854
deploy:
6955
provider: pages
7056
skip_cleanup: true
7157
github-token: $GITHUB_TOKEN
7258
local_dir: docs/
59+
- stage: report_coverage
60+
name: report_coverage
61+
# Generating test coverage report and publishing to Codacy
62+
script:
63+
- mvn cobertura:cobertura -B
64+
- curl -Ls -o codacy-coverage-reporter-assembly.jar https://github.com/codacy/codacy-coverage-reporter/releases/download/6.0.2/codacy-coverage-reporter-6.0.2-assembly.jar
65+
- java -jar codacy-coverage-reporter-assembly.jar report -l Java -r target/site/cobertura/coverage.xml

README.md

+12-14
Original file line numberDiff line numberDiff line change
@@ -18,65 +18,63 @@
1818
<img src="./images/eiffel-intelligence-logo.png" alt="Eiffel Intelligence" width="350"/>
1919

2020
[![Build Status](https://travis-ci.org/eiffel-community/eiffel-intelligence.svg?branch=master)](https://travis-ci.org/eiffel-community/eiffel-intelligence)
21-
[![Coverage Status](https://coveralls.io/repos/github/eiffel-community/eiffel-intelligence/badge.svg?branch=master)](https://coveralls.io/github/eiffel-community/eiffel-intelligence?branch=master)
21+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f596eed2020e4340ab1d8deb2fb4c680)](https://www.codacy.com/app/eiffel-intelligence-maintainers/eiffel-intelligence?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=eiffel-community/eiffel-intelligence&amp;utm_campaign=Badge_Grade)
22+
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/f596eed2020e4340ab1d8deb2fb4c680)](https://www.codacy.com/app/eiffel-intelligence-maintainers/eiffel-intelligence?utm_source=github.com&utm_medium=referral&utm_content=eiffel-community/eiffel-intelligence&utm_campaign=Badge_Coverage)
2223
[![](https://jitpack.io/v/eiffel-community/eiffel-intelligence.svg)](https://jitpack.io/#eiffel-community/eiffel-intelligence)
2324

2425
# Eiffel Intelligence
2526
Eiffel Intelligence is a real time data aggregation and analysis solution
2627
for Eiffel events. While Eiffel represents an event based architecture,
2728
Eiffel Intelligence addresses the need of stakeholders to view the current
2829
state of the system by bridging the divide from immutable events to mutable
29-
state representation.
30+
state representation. More information [can be found here](https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/markdown/index.md).
3031

3132
Eiffel Intelligence consists of two components: the Eiffel Intelligence
3233
back-end (this repository) and the [Eiffel Intelligence front-end](https://github.com/eiffel-community/eiffel-intelligence-frontend),
3334
which is a graphical user interface.
3435

35-
## What is Eiffel Intelligence?
36-
More information about what Eiffel Intelligence is and what it can be used for [can be read here](https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/markdown/index.md).
37-
38-
# About this repository
36+
## About this repository
3937
The contents of this repository are licensed under the [Apache License 2.0](./LICENSE).
4038

4139
To get involved, please see [Code of Conduct](./CODE_OF_CONDUCT.md) and [contribution guidelines](./CONTRIBUTING.md).
4240

43-
# About Eiffel
41+
## About Eiffel
4442
This repository forms part of the Eiffel Community. Eiffel is a protocol for technology agnostic machine-to-machine communication in continuous integration and delivery pipelines, aimed at securing scalability, flexibility and traceability. Eiffel is based on the concept of decentralized real time messaging, both to drive the continuous integration and delivery system and to document it.
4543

4644
Visit [Eiffel Community](https://eiffel-community.github.io) to get started and get involved.
4745

48-
# Documentation
46+
## Documentation
4947

5048
1. [**Running Eiffel Intelligence**](wiki/markdown/running-eiffel-intelligence.md)
5149
- [**Prerequisites**](wiki/markdown/running-eiffel-intelligence.md#Prerequisites)
5250
- [**Configuration**](wiki/markdown/configuration.md)
5351
- [**Run in Docker**](wiki/markdown/docker.md)
54-
1. [**Understanding subscriptions**](wiki/markdown/subscriptions.md)
52+
2. [**Understanding subscriptions**](wiki/markdown/subscriptions.md)
5553
- [**REST POST notification**](wiki/markdown/subscription-with-REST-POST-notification.md)
5654
- [**HTTP POST notification to trigger parameterized Jenkins jobs**](wiki/markdown/triggering-jenkins-jobs.md)
5755
- [**Email notification**](wiki/markdown/subscription-with-email-notification.md)
5856
- [**Step by Step Subscription Notification**](wiki/markdown/step-by-step-subscription-notification.md)
59-
1. [**Understanding rules**](wiki/markdown/rules.md)
57+
3. [**Understanding rules**](wiki/markdown/rules.md)
6058
- [**What is JMESPath?**](wiki/markdown/rules.md#What-is-JMESPath?)
6159
- [**Rule set up**](wiki/markdown/rules.md#Rule-set-up)
6260
- [**MergeResolverRules**](wiki/markdown/merge-resolver-rules.md)
6361
- [**History Rules**](wiki/markdown/history-rules.md)
6462
- [**Existing rules files**](wiki/markdown/existing-rules-files.md)
6563
- [**Mapping Rules To Aggregations**](wiki/markdown/mapping-rules-to-aggregations.md)
66-
1. [**Step by Step Aggregation on Eiffel events**](wiki/markdown/step-by-step-aggregation.md)
64+
4. [**Step by Step Aggregation on Eiffel events**](wiki/markdown/step-by-step-aggregation.md)
6765
- [**ArtifactCreatedEvent Aggregation**](wiki/markdown/artifact-created-event-aggregation.md)
6866
- [**TestCaseTriggeredEvent Aggregation**](wiki/markdown/test-case-triggered-event-aggregation.md)
6967
- [**TestCaseStartedEvent Aggregation**](wiki/markdown/test-case-started-event-aggregation.md)
7068
- [**TestCaseFinishedEvent Aggregation**](wiki/markdown/test-case-finished-event-aggregation.md)
7169
- [**ArtifactPublishedEvent Aggregation**](wiki/markdown/artifact-published-event-aggregation.md)
7270
- [**ConfidenceLevelModifiedEvent Aggregation**](wiki/markdown/confidence-level-modified-event-aggregation.md)
73-
1. [**REST API**](wiki/markdown/REST-API.md)
71+
5. [**REST API**](wiki/markdown/REST-API.md)
7472
- [**Query aggregated objects**](wiki/markdown/query.md)
7573
- [**Running rules on objects**](wiki/markdown/running-rules-on-objects.md)
7674
- [**Authentication**](wiki/markdown/authentication.md)
7775
- [**Subscriptions**](wiki/markdown/subscription-API.md)
7876
- [**Download files**](wiki/markdown/download-files.md)
79-
1. [**Compatibility**](wiki/markdown/compatibility.md)
80-
1. [**Known limitations**](wiki/markdown/known-limitations.md)
77+
6. [**Compatibility**](wiki/markdown/compatibility.md)
78+
7. [**Known limitations**](wiki/markdown/known-limitations.md)
8179

8280
**Eiffel Intelligence documentation** [**can be found here**](https://eiffel-community.github.io/eiffel-intelligence/)

pom.xml

+11
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,17 @@
586586
</dependency>
587587
</dependencies>
588588
</plugin>
589+
<plugin>
590+
<groupId>org.codehaus.mojo</groupId>
591+
<artifactId>cobertura-maven-plugin</artifactId>
592+
<version>2.7</version>
593+
<configuration>
594+
<formats>
595+
<format>html</format>
596+
<format>xml</format>
597+
</formats>
598+
</configuration>
599+
</plugin>
589600
</plugins>
590601
</build>
591602
</project>

0 commit comments

Comments
 (0)