-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add JUNit support * a * test * asd * fix * Fix unit tests and code * fix * fix * fix * fix * fix * fix * fix * Update README.md Signed-off-by: Joel Dickson <[email protected]> --------- Signed-off-by: Joel Dickson <[email protected]> Co-authored-by: Joel Dickson <[email protected]>
- Loading branch information
1 parent
56bdb7e
commit 2ebf78f
Showing
13 changed files
with
879 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Java CI with Gradle and Maven Central Upload | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew build | ||
continue-on-error: true | ||
|
||
- name: Run tests | ||
run: ./gradlew test | ||
|
||
- name: Upload Test results | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: test-report | ||
path: build/reports | ||
|
||
- name: Publish to Maven Central | ||
if: github.event_name == 'release' | ||
run: | | ||
./gradlew publish | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | ||
GPG_SIGNING_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | ||
GPG_SIGNING_PASSWORD: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ossrhUsername=your_username | ||
ossrhPassword=your_password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,63 @@ | ||
# java-local-metrics | ||
# Developer Experience Metrics Library | ||
|
||
## Overview | ||
|
||
The Developer Experience Metrics Library is an open-source Java tool designed to measure and improve the developer experience on local workstations. By providing insights into test execution, build times, and system resource usage, this library helps development teams identify bottlenecks, optimize workflows, and enhance overall productivity. | ||
|
||
## Features | ||
|
||
- **Test Execution Metrics**: Capture detailed information about JUnit test runs, including execution time, pass/fail status, and system resource usage during tests. | ||
|
||
## Requirements | ||
|
||
Minimum Java Version 11 | ||
|
||
## Installation | ||
|
||
### Maven | ||
|
||
Add the following dependency to your `pom.xml`: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>io.agodadev.testmetrics</groupId> | ||
<artifactId>dev-experience-metrics</artifactId> | ||
<version>1.0.0</version> | ||
</dependency> | ||
``` | ||
|
||
### Gradle | ||
|
||
Add the following to your `build.gradle`: | ||
|
||
```gradle | ||
implementation 'io.agodadev.testmetrics:dev-experience-metrics:1.0.0' | ||
``` | ||
|
||
## Quick Start | ||
|
||
|
||
### 1. Configure JUnit Listener | ||
|
||
Add the following VM option to your JUnit run configuration: | ||
|
||
``` | ||
-Djunit.runner.addListeners=io.agodadev.testmetrics.LocalCollectionTestRunListener | ||
``` | ||
|
||
## Contributing | ||
|
||
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for more details. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
|
||
## Acknowledgments | ||
|
||
- Thanks to all the contributors who have helped shape this project. | ||
- Special thanks to the JUnit team for their excellent testing framework. | ||
|
||
--- | ||
|
||
Happy coding, and may your development experience be ever improving! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
plugins { | ||
id 'java' | ||
id 'maven-publish' | ||
id 'signing' | ||
} | ||
|
||
group = 'io.agodadev' | ||
version = '1.0.0' | ||
|
||
sourceCompatibility = '11' | ||
targetCompatibility = '11' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'junit:junit:4.13.2' | ||
testImplementation 'org.mockito:mockito-core:3.12.4' | ||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0' | ||
} | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
|
||
pom { | ||
name = 'testmetrics' | ||
description = 'A library for measuring and improving developer experience on local workstations.' | ||
url = 'https://github.com/agodadev/testmetrics' | ||
|
||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
name = 'Joel Dickson' | ||
email = '[email protected]' | ||
organization = 'agoda' | ||
organizationUrl = 'http://www.agoda.com' | ||
} | ||
} | ||
|
||
scm { | ||
connection = 'scm:[email protected]:agoda-com/java-local-metrics.git' | ||
developerConnection = 'scm:git:ssh://github.com:agoda-com/java-local-metrics.git' | ||
url = 'https://github.com/agoda-com/java-local-metrics/tree/main' | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = "OSSRH" | ||
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
credentials { | ||
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "dummy" | ||
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "dummy" | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
signing { | ||
def signingKey = System.getenv("GPG_SIGNING_KEY") | ||
def signingPassword = System.getenv("GPG_SIGNING_PASSWORD") | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign publishing.publications.mavenJava | ||
} | ||
|
||
|
||
javadoc { | ||
if(JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.