|
3 | 3 | We introduced breaking changes in version `2.0.0` described below. |
4 | 4 |
|
5 | 5 | ### SnowSQL Config File |
6 | | -Instead of continuing to use plugin DSL or Gradle properties to provide Snowflake authentication, I made the |
| 6 | +Instead of continuing to use plugin DSL or Gradle properties to provide Snowflake authentication, we made the |
7 | 7 | decision to switch to using the SnowSQL config moving forward. |
8 | 8 | This was inspired by the [Snowflake Developer CLI](https://github.com/Snowflake-Labs/snowcli) project, and it seems to |
9 | 9 | be a reasonable standard moving forward. |
@@ -210,7 +210,7 @@ BUILD SUCCESSFUL in 624ms |
210 | 210 |
|
211 | 211 | This project uses the [S3 Gradle build cache plugin](https://github.com/burrunan/gradle-s3-build-cache) |
212 | 212 | and we are very happy with it. |
213 | | -Check the [Gradle settings file](setting.gradle) for an implementation example. |
| 213 | +Check the [Gradle settings file](settings.gradle) for an implementation example. |
214 | 214 |
|
215 | 215 | # Testing |
216 | 216 | Gradle |
@@ -279,7 +279,20 @@ All unit tests in either `src/test/java` (written using JUnit or something else) |
279 | 279 | we automatically run whenever the `test` or `build` task is executed. |
280 | 280 |
|
281 | 281 | ```shell |
282 | | -./gradlew build |
| 282 | +❯ ./gradlew build |
| 283 | + |
| 284 | +> Task :test |
| 285 | + |
| 286 | +SampleTest |
| 287 | + |
| 288 | + Test adding 1 and 2 PASSED |
| 289 | + Test adding 3 and 4 PASSED |
| 290 | + |
| 291 | +SUCCESS: Executed 2 tests in 487ms |
| 292 | + |
| 293 | + |
| 294 | +BUILD SUCCESSFUL in 1s |
| 295 | +9 actionable tasks: 5 executed, 4 up-to-date |
283 | 296 | ``` |
284 | 297 |
|
285 | 298 | All Gradle testing tasks are automatically incremental and cacheable, and would be avoided if executed again without changes to the code in either the source or the spec. |
@@ -352,6 +365,44 @@ class SnowflakeSampleTest extends SnowflakeSpec { |
352 | 365 | The `selectSingleValue` method returns the first column from the first row in a `SELECT` statement, |
353 | 366 | so it's perfect for testing a function. And of course, this executes against Snowflake in real time. |
354 | 367 |
|
| 368 | +```shell |
| 369 | +❯ ./gradlew functionalTest |
| 370 | + |
| 371 | +> Task :test |
| 372 | + |
| 373 | +SampleTest |
| 374 | + |
| 375 | + Test adding 1 and 2 PASSED |
| 376 | + Test adding 3 and 4 PASSED |
| 377 | + |
| 378 | +SUCCESS: Executed 2 tests in 462ms |
| 379 | + |
| 380 | + |
| 381 | +> Task :snowflakeJvm |
| 382 | +Using snowsql config file: /Users/stewartbryson/.snowsql/config |
| 383 | +File java-testing-0.1.0-all.jar: UPLOADED |
| 384 | +Deploying ==> |
| 385 | +CREATE OR REPLACE function add_numbers (a integer, b integer) |
| 386 | + returns string |
| 387 | + language JAVA |
| 388 | + handler = 'Sample.addNum' |
| 389 | + imports = ('@upload/libs/java-testing-0.1.0-all.jar') |
| 390 | + |
| 391 | + |
| 392 | +> Task :functionalTest |
| 393 | + |
| 394 | +SnowflakeSampleTest |
| 395 | + |
| 396 | + Test ADD_NUMBERS() function with 1 and 2 PASSED |
| 397 | + Test ADD_NUMBERS() function with 3 and 4 PASSED |
| 398 | + |
| 399 | +SUCCESS: Executed 2 tests in 3.4s |
| 400 | + |
| 401 | + |
| 402 | +BUILD SUCCESSFUL in 9s |
| 403 | +11 actionable tasks: 7 executed, 4 up-to-date |
| 404 | +``` |
| 405 | + |
355 | 406 | ### Testing with Ephemeral Database Clones |
356 | 407 | Running functional tests using static Snowflake databases is boring, especially considering |
357 | 408 | the [zero-copy cloning](https://docs.snowflake.com/en/user-guide/object-clone.html#cloning-considerations) functionality |
|
0 commit comments