clouWay Cloud Datastore Testing Library

clouWay Datastore Testing Library

Лицензия

Лицензия

Категории

Категории

Данные
Группа

Группа

com.clouway.testing
Идентификатор

Идентификатор

cloud-datastore-testing
Последняя версия

Последняя версия

0.0.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

clouWay Cloud Datastore Testing Library
clouWay Datastore Testing Library
Ссылка на сайт

Ссылка на сайт

https://github.com/clouway/cloud-datastore-testing
Система контроля версий

Система контроля версий

https://github.com/clouway/cloud-datastore-testing

Скачать cloud-datastore-testing

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.clouway.testing/cloud-datastore-testing/ -->
<dependency>
    <groupId>com.clouway.testing</groupId>
    <artifactId>cloud-datastore-testing</artifactId>
    <version>0.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.clouway.testing/cloud-datastore-testing/
implementation 'com.clouway.testing:cloud-datastore-testing:0.0.3'
// https://jarcasting.com/artifacts/com.clouway.testing/cloud-datastore-testing/
implementation ("com.clouway.testing:cloud-datastore-testing:0.0.3")
'com.clouway.testing:cloud-datastore-testing:jar:0.0.3'
<dependency org="com.clouway.testing" name="cloud-datastore-testing" rev="0.0.3">
  <artifact name="cloud-datastore-testing" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.clouway.testing', module='cloud-datastore-testing', version='0.0.3')
)
libraryDependencies += "com.clouway.testing" % "cloud-datastore-testing" % "0.0.3"
[com.clouway.testing/cloud-datastore-testing "0.0.3"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.4.10
org.testcontainers : testcontainers jar 1.15.0-rc2
com.google.cloud : google-cloud-datastore jar 1.105.0
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Cloud Datastore Testing Package

A testing package of cloud-datastore.

Adding as dependency

In Gradle:

repositories {
  mavenCentral()
}

dependencies {
     compile 'com.clouway.testing:cloud-datastore-testing:0.0.1'
}

In Maven:

 <dependency>
    <groupId>com.clouway.testing</groupId>
    <artifactId>cloud-datastore-testing</artifactId>
    <version>0.0.1</version>
 </dependency>

Usage

  • Unit Testing with JUnit 4.x
  @Rule
  @JvmField
  val context = JUnitRuleMockery()

  companion object {
    @ClassRule
    @JvmField
    val datastoreRule = DatastoreRule()
  }

  @Rule
  @JvmField
  var cleaner = DatastoreCleaner { datastoreRule.port }

  // ....
   
  @Test
  fun happyPath() {
    val datastore = datastoreRuel.datastore
    // do datastore persistent logic
  }
   
  • Jenkins CI Usage
    As cloud-datastore-testing library is using docker for running of the emulator it is required the following environment variables to be passed from the CI:
  export DATASTORE_HOST=xxxx
  export DATASTORE_PORT=5000

Here is a complete Jenkins example:

docker.image('google/cloud-sdk:latest').withRun('--entrypoint gcloud', 'beta emulators datastore start --no-legacy --project testing --host-port=0.0.0.0:8888 --consistency=1 --no-store-on-disk') { c ->
   docker.image('yourimage').inside("-e CI=true -e DATASTORE_HOST=datastore -e DATASTORE_PORT=8888 --link ${c.id}:datastore") {
       // perform your test execution here  
   }
}

Contributing

If you would like to contribute code to pcache client you can do so through GitHub by forking the repository and sending a pull request. When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Please also make sure your code compiles by running gradle clean build.

com.clouway.testing

clouWay ood

Версии библиотеки

Версия
0.0.3
0.0.2
0.0.1