Skip to content

Commit

Permalink
Update keploy-karaf.md
Browse files Browse the repository at this point in the history
Signed-off-by: Sarthak Shyngle <[email protected]>
  • Loading branch information
Sarthak160 authored Jan 19, 2025
1 parent 1a8d3e3 commit 63b317f
Showing 1 changed file with 37 additions and 20 deletions.
57 changes: 37 additions & 20 deletions versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,14 @@ wget https://keploy-enterprise.s3.us-west-2.amazonaws.com/agent-jars/org.jacoco.
### Update `config.properties`

1. Navigate to the `etc/config.properties` file in your Karaf installation.

Check failure on line 59 in versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md

View workflow job for this annotation

GitHub Actions / vale

[vale] versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md#L59

[Vale.Spelling] Did you really mean 'Karaf'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'Karaf'?", "location": {"path": "versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md", "range": {"start": {"line": 59, "column": 57}}}, "severity": "ERROR"}
2. Add the following entry under the `bootdelegation` section to allow OSGi bundles to access Keploy artifacts:
2. Add the following entries under the `bootdelegation` section to allow OSGi bundles to access Keploy artifacts:

Check failure on line 60 in versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md

View workflow job for this annotation

GitHub Actions / vale

[vale] versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md#L60

[Vale.Spelling] Did you really mean 'OSGi'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'OSGi'?", "location": {"path": "versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md", "range": {"start": {"line": 60, "column": 74}}}, "severity": "ERROR"}

```properties
org.osgi.framework.bootdelegation = \
com.sun.*, \
javax.transaction, \
javax.transaction.xa, \
javax.xml.crypto, \
javax.xml.crypto.*, \
javax.security.cert, \
jdk.nashorn.*, \
sun.*, \
jdk.internal.reflect, \
jdk.internal.reflect.*, \
org.apache.karaf.jaas.boot, \
org.apache.karaf.jaas.boot.principal, \
io.keploy.*
... \
io.keploy.*, \
javax.servlet, \
javax.servlet.http
```

## Step 3: Start Apache Karaf and Export Environment Variables

Check failure on line 70 in versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md

View workflow job for this annotation

GitHub Actions / vale

[vale] versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md#L70

[Vale.Spelling] Did you really mean 'Karaf'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'Karaf'?", "location": {"path": "versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md", "range": {"start": {"line": 70, "column": 25}}}, "severity": "ERROR"}
Expand All @@ -100,7 +91,25 @@ wget https://keploy-enterprise.s3.us-west-2.amazonaws.com/agent-jars/org.jacoco.

Replace the `APP_PATH` value with the absolute path to your application's target folder.

## Step 4: Import Postman Collection
## Step 4: Record Test Cases

1. Restart Apache Karaf by setting the environment variable `KEPLOY_MODE` to `RECORD`:

Check failure on line 96 in versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md

View workflow job for this annotation

GitHub Actions / vale

[vale] versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md#L96

[Vale.Spelling] Did you really mean 'Karaf'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'Karaf'?", "location": {"path": "versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md", "range": {"start": {"line": 96, "column": 19}}}, "severity": "ERROR"}

```bash
export KEPLOY_MODE="RECORD"
./karaf
```

2. Record test cases using the following command:

```bash
keploy record --base-url="http://localhost:8181"
```

3. Make a series of API calls to your application's endpoints.
4. After completing the API calls, press `Ctrl+C` in the session where you are running the Keploy binary to stop recording. You will see a new set of test set formed having testcases created by keploy.

## Step 5: Or Use Import Postman Collection

1. Ensure you have a Postman collection ready for your application.
2. Run the following command to import the Postman collection as Keploy tests:
Expand All @@ -111,14 +120,22 @@ wget https://keploy-enterprise.s3.us-west-2.amazonaws.com/agent-jars/org.jacoco.

Replace `/path/to/YourPostmanCollection.json` with the actual path to your Postman collection.

## Step 5: Run Keploy Tests
## Step 6: Run Keploy Tests

Use the following command to run the imported tests:
1. Restart Apache Karaf by setting the environment variable `KEPLOY_MODE` to `test`:

Check failure on line 125 in versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md

View workflow job for this annotation

GitHub Actions / vale

[vale] versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md#L125

[Vale.Spelling] Did you really mean 'Karaf'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'Karaf'?", "location": {"path": "versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md", "range": {"start": {"line": 125, "column": 19}}}, "severity": "ERROR"}

```bash
keploy test --base-path="http://localhost:8181"
```
```bash
export KEPLOY_MODE="test"
./karaf
```

2. Use the following command to run the imported tests:

```bash
keploy test --base-path="http://localhost:8181"
```

This assumes your Karaf application is running locally on port 8181.

Check failure on line 138 in versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md

View workflow job for this annotation

GitHub Actions / vale

[vale] versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md#L138

[Vale.Spelling] Did you really mean 'Karaf'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'Karaf'?", "location": {"path": "versioned_docs/version-2.0.0/running-keploy/keploy-karaf.md", "range": {"start": {"line": 138, "column": 19}}}, "severity": "ERROR"}

After running the tests, a `coverage.xml` file will be generated in the root directory of your project. This file contains the test coverage report, which can be used for further analysis or integrated with CI/CD pipelines.

0 comments on commit 63b317f

Please sign in to comment.