Skip to content

Commit

Permalink
Merge pull request #262 from ballerina-platform/dev
Browse files Browse the repository at this point in the history
Add mock server for tests
  • Loading branch information
niveathika authored Dec 12, 2023
2 parents 8df09ca + 1f7c500 commit b926560
Show file tree
Hide file tree
Showing 16 changed files with 1,348 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main
secrets: inherit
with:
additional-build-flags: "-x :googleapis.gmail-examples:build"
additional-build-flags: "-x :googleapis.gmail-examples:build -Pgroups=mock"
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ jobs:
secrets: inherit
with:
repo-name: module-ballerinax-googleapis.gmail
additional-test-flags: -Pgroups=mock
2 changes: 1 addition & 1 deletion .github/workflows/dev-stage-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
additional-publish-flags: "-x :googleapis.gmail-examples:build"
additional-publish-flags: "-x :googleapis.gmail-examples:build -Pgroups=mock"
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ jobs:
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/pr-build-connector-template.yml@main
secrets: inherit
with:
additional-test-flags: -Pgroups=mock
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
uses: ballerina-platform/ballerina-standard-library/.github/workflows/trivy-scan-template.yml@main
secrets: inherit
with:
additional-build-flags: "-x :googleapis.gmail-examples:build"
additional-build-flags: "-x :googleapis.gmail-examples:build -Pgroups=mock"
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,25 +188,37 @@ Execute the commands below to build from the source.
./gradlew clean build -x test
```

4. To debug package with a remote debugger:
4. To run tests against different environment:

```bash
./gradlew clean test -Pgroups=<Comma separated groups/test cases>
```

Tip: The following groups of test cases are available.
Groups | Environment
---| ---
mock | Mock server
gmail | Gmail API

5. To debug package with a remote debugger:

```bash
./gradlew clean build -Pdebug=<port>
```

5. To debug with the Ballerina language:
6. To debug with the Ballerina language:

```bash
./gradlew clean build -PbalJavaDebug=<port>
```

6. Publish the generated artifacts to the local Ballerina Central repository:
7. Publish the generated artifacts to the local Ballerina Central repository:

```bash
./gradlew clean build -PpublishToLocalCentral=true
```

7. Publish the generated artifacts to the Ballerina Central repository:
8. Publish the generated artifacts to the Ballerina Central repository:

```bash
./gradlew clean build -PpublishToCentral=true
Expand Down
2 changes: 1 addition & 1 deletion ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
distribution = "2201.8.0"
org = "ballerinax"
name = "googleapis.gmail"
version = "4.0.0"
version = "4.0.1"
authors = ["Ballerina"]
export = ["googleapis.gmail"]
repository = "https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail"
Expand Down
9 changes: 7 additions & 2 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.10.4"
version = "2.10.5"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -220,6 +220,9 @@ dependencies = [
{org = "ballerina", name = "lang.value"},
{org = "ballerina", name = "observe"}
]
modules = [
{org = "ballerina", packageName = "log", moduleName = "log"}
]

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -334,12 +337,13 @@ modules = [
[[package]]
org = "ballerinax"
name = "googleapis.gmail"
version = "4.0.0"
version = "4.0.1"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "io"},
{org = "ballerina", name = "lang.array"},
{org = "ballerina", name = "lang.runtime"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "os"},
{org = "ballerina", name = "test"},
{org = "ballerina", name = "url"},
Expand All @@ -348,6 +352,7 @@ dependencies = [
]
modules = [
{org = "ballerinax", packageName = "googleapis.gmail", moduleName = "googleapis.gmail"},
{org = "ballerinax", packageName = "googleapis.gmail", moduleName = "googleapis.gmail.mock"},
{org = "ballerinax", packageName = "googleapis.gmail", moduleName = "googleapis.gmail.oas"}
]

2 changes: 1 addition & 1 deletion ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def stripBallerinaExtensionVersion(String extVersion) {
ballerina {
packageOrganization = packageOrg
module = packageName
testCoverageParam = "--code-coverage --coverage-format=xml --excludes=\"modules/oas/**\""
testCoverageParam = "--code-coverage --coverage-format=xml --excludes=\"modules/**/**\""
isConnector = true
platform = "any"
}
Expand Down
Loading

0 comments on commit b926560

Please sign in to comment.