Skip to content

Chore: Integrate GitHub cicd for Java Petclinic application #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
39dc503
Chore:java quickstart petclinic Dockerfile and new tests added
Achanandhi-M Apr 11, 2025
2f39817
Chore: Added github cicd integration file
Achanandhi-M Apr 12, 2025
b714823
Chore: Added github cicd integration file
Achanandhi-M Apr 12, 2025
7310911
jenkins-file-added
Achanandhi-M Apr 14, 2025
da68828
jenkins-file-added
Achanandhi-M Apr 14, 2025
8ea8d8e
jenkins-file-modified
Achanandhi-M Apr 14, 2025
b165d54
jenkins-file-directory-changed
Achanandhi-M Apr 14, 2025
73f87aa
jenkins-file-directory-changed
Achanandhi-M Apr 14, 2025
4c1a24c
jenkins-file-debug-flag-added
Achanandhi-M Apr 14, 2025
b3b1c1a
jenkins-file-debug-flag-added
Achanandhi-M Apr 14, 2025
ce90e68
jenkins-file-debug-flag-added
Achanandhi-M Apr 14, 2025
b1ced89
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
570128a
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
42deb3a
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
0d53399
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
40380f6
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
80465e4
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
25dc279
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
f30d687
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
5e18ff9
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
a0c65f3
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
74fd7c7
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
5d1ff9e
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
b21c7e2
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
9f3db55
jenkins-file-command-added
Achanandhi-M Apr 14, 2025
fd21c99
last-one
Achanandhi-M Apr 14, 2025
08591f9
last-one
Achanandhi-M Apr 14, 2025
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
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.qodo
35 changes: 35 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
pipeline {
agent any

stages {
stage('Keploy Tests') {
steps {
sh '''
# Update and install required packages
sudo apt-get update && sudo apt-get install -y curl kmod linux-headers-generic bpfcc-tools git openjdk-17-jdk

# Clone the repo
git clone -b chore/Integrate-github-cicd https://github.com/Achanandhi-M/samples-java.git
cd samples-java/spring-petclinic/spring-petclinic-rest

# Create directories required by eBPF
sudo mkdir -p /sys/kernel/debug
sudo mkdir -p /sys/kernel/tracing

# Download and install Keploy
curl --silent -O -L https://keploy.io/install.sh && bash install.sh

# Mount debugfs and tracefs if not already mounted
sudo mount -t debugfs nodev /sys/kernel/debug || true
sudo mount -t tracefs nodev /sys/kernel/tracing || true

# Build the app using Maven wrapper
./mvnw package -DskipTests

# Run Keploy test
keploy test -c "java -jar target/spring-petclinic-rest-3.0.2.jar" --delay 20 --language java
'''
}
}
}
}
1 change: 1 addition & 0 deletions spring-petclinic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.qodo
43 changes: 43 additions & 0 deletions spring-petclinic/github-cicd-integration/github-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Java Keploy Tests

on:
push:
branches: [ main ]

jobs:
keploy-java-tests:
runs-on: ubuntu-latest

steps:

- name: Checkout Repository
uses: actions/checkout@v4.2.2

- name: Set up Node.js environment
uses: actions/setup-node@v4.3.0
with:
node-version: '20.9.0'

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'

- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: '3.8.2'

- name: Build spring-petclinic-rest
working-directory: spring-petclinic/spring-petclinic-rest
run: mvn clean install -DskipTests

- name: Download and Install Keploy
working-directory: spring-petclinic/spring-petclinic-rest
run: |
curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_amd64.tar.gz" | tar xz --overwrite -C /tmp
sudo mkdir -p /usr/local/bin && sudo mv /tmp/keploy /usr/local/bin/keploy
run: |
sudo keploy test -c "java -jar target/spring-petclinic-rest-3.0.2.jar" -t test-set-0 --delay 60
# The above command works only if you have already generated the test case. The -t flag is used to include a specific test case.
114 changes: 114 additions & 0 deletions spring-petclinic/keploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Generated by Keploy (0.11.22)
path: ""
appId: 0
appName: spring-petclinic
command: docker compose up
templatize:
testSets: []
port: 0
e2e: false
dnsPort: 26789
proxyPort: 16789
debug: false
disableTele: false
disableANSI: false
containerName: javaApp
networkName: ""
buildDelay: 30
test:
selectedTests: {}
globalNoise:
global: {}
test-sets: {}
delay: 5
host: ""
port: 0
apiTimeout: 5
skipCoverage: false
coverageReportPath: ""
ignoreOrdering: true
mongoPassword: default@123
language: ""
removeUnusedMocks: false
fallBackOnMiss: false
jacocoAgentPath: ""
basePath: ""
mocking: true
ignoredTests: {}
disableLineCoverage: false
disableMockUpload: false
useLocalMock: false
updateTemplate: false
freezeTime: false
record:
filters: []
basePath: ""
recordTimer: 0s
agent: false
configPath: ""
bypassRules: []
generateGithubActions: false
keployContainer: keploy-v2
keployNetwork: keploy-network
cmdType: native
contract:
services: []
tests: []
path: ""
download: false
generate: false
driven: consumer
mappings:
servicesMapping: {}
self: s1
inCi: false
autogen:
filters: []
basePath: ""
recordTimer: 0s
schemaPath: ""
header: ""
dedup:
selectedTests: {}
globalNoise:
global: {}
test-sets: {}
delay: 0
host: ""
port: 0
apiTimeout: 0
skipCoverage: false
coverageReportPath: ""
ignoreOrdering: false
mongoPassword: ""
language: ""
removeUnusedMocks: false
fallBackOnMiss: false
jacocoAgentPath: ""
basePath: ""
mocking: true
ignoredTests: {}
disableLineCoverage: false
disableMockUpload: false
useLocalMock: false
updateTemplate: false
rm: false
freezeTime: false
generateParallel:
retryEnabled: false
cores: 0
utGen:
llmBaseUrl: ""
model: ""
llmApiVersion: ""
workflow:
installationToken: ""
coverageWorkflow: false
prWorkflow: false
repoName: ""
prNumber: 0
jwtToken: ""
InstallationID: 0
eventID: ""

# Visit [https://keploy.io/docs/running-keploy/configuration-file/] to learn about using keploy through configration file.
Loading