-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from stewartbryson/stewart
Release 2.0.0
- Loading branch information
Showing
92 changed files
with
2,236 additions
and
1,563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "GITHUB_RUN_ID $GITHUB_RUN_ID" | ||
echo "GITHUB_EVENT_NAME $GITHUB_EVENT_NAME" | ||
echo "GITHUB_SHA $GITHUB_SHA" | ||
echo "GITHUB_REF $GITHUB_REF" | ||
echo "GITHUB_HEAD_REF $GITHUB_HEAD_REF" | ||
echo "GITHUB_BASE_REF $GITHUB_BASE_REF" | ||
echo "GITHUB_REPOSITORY $GITHUB_REPOSITORY" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+60.1 KB
...lin-jar/gradle/wrapper/gradle-wrapper.jar → .../groovy/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../gradle/wrapper/gradle-wrapper.properties → .../gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rootProject.name = 'groovy' | ||
// ignore this: used for testing examples during releases | ||
includeBuild('../../') |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+60.1 KB
...ala-jar/gradle/wrapper/gradle-wrapper.jar → ...l-stage/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../gradle/wrapper/gradle-wrapper.properties → .../gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rootProject.name = 'java-external-stage' | ||
// ignore this: used for testing examples during releases | ||
includeBuild('../../') |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'java-manual' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
plugins { | ||
id 'java' | ||
id 'groovy' // needed for Spock testing framework | ||
id 'io.github.stewartbryson.snowflake' version '1.1.4' | ||
id 'com.adarshr.test-logger' version '3.2.0' // added for testing | ||
id 'com.github.ben-manes.versions' version '0.46.0' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() // added for functionalTest dependency | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(11) | ||
} | ||
} | ||
|
||
snowflake { | ||
connection = 'gradle_plugin' | ||
stage = 'upload' | ||
// Explained in the Ephemeral Cloning section | ||
useEphemeral = project.snowflake.isCI() // use ephemeral with CICD workflows | ||
keepEphemeral = project.snowflake.isPR() // keep ephemeral for PRs | ||
applications { | ||
add_numbers { | ||
inputs = ["a integer", "b integer"] | ||
returns = "string" | ||
handler = "Sample.addNum" | ||
} | ||
} | ||
} | ||
|
||
// Explained in the Testing section | ||
testing { | ||
suites { | ||
test { | ||
useSpock('2.3-groovy-3.0') | ||
} | ||
functionalTest(JvmTestSuite) { | ||
targets { | ||
all { | ||
useSpock('2.3-groovy-3.0') | ||
dependencies { | ||
implementation "io.github.stewartbryson:gradle-snowflake-plugin:1.1.4" | ||
} | ||
testTask.configure { | ||
failFast true | ||
// which SnowSQL connection to use | ||
systemProperty 'connection', project.snowflake.connection | ||
// if this is ephemeral, the test spec needs the name to connect to | ||
if (project.snowflake.useEphemeral) { | ||
systemProperty 'ephemeralName', snowflake.ephemeralName | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
version='0.1.0' |
Binary file renamed
BIN
+60.1 KB
...ple-jar/gradle/wrapper/gradle-wrapper.jar → ...testing/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../gradle/wrapper/gradle-wrapper.properties → .../gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rootProject.name = 'java-testing' | ||
// ignore this: used for testing examples during releases | ||
includeBuild('../../') |
28 changes: 28 additions & 0 deletions
28
examples/java-testing/src/functionalTest/groovy/SnowflakeSampleTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import groovy.util.logging.Slf4j | ||
import io.github.stewartbryson.SnowflakeSpec | ||
|
||
/** | ||
* The SnowflakeSpec used for testing functions. | ||
*/ | ||
@Slf4j | ||
class SnowflakeSampleTest extends SnowflakeSpec { | ||
|
||
def 'ADD_NUMBERS() function with 1 and 2'() { | ||
when: "Two numbers exist" | ||
def one = 1 | ||
def two = 2 | ||
|
||
then: 'Add two numbers using ADD_NUMBERS()' | ||
selectSingleValue("select add_numbers($one,$two);") == 'Sum is: 3' | ||
} | ||
|
||
def 'ADD_NUMBERS() function with 3 and 4'() { | ||
when: "Two numbers exist" | ||
def three = 3 | ||
def four = 4 | ||
|
||
then: 'Add two numbers using ADD_NUMBERS()' | ||
selectSingleValue("select add_numbers($three,$four);") == 'Sum is: 7' | ||
} | ||
|
||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import spock.lang.Shared | ||
import spock.lang.Specification | ||
import spock.lang.Subject | ||
|
||
class SampleTest extends Specification { | ||
@Shared | ||
@Subject | ||
def sample = new Sample() | ||
|
||
def "adding 1 and 2"() { | ||
when: "Two numbers" | ||
def one = 1 | ||
def two = 2 | ||
then: "Add numbers" | ||
sample.addNum(one, two) == "Sum is: 3" | ||
} | ||
|
||
def "adding 3 and 4"() { | ||
when: "Two numbers" | ||
def one = 3 | ||
def two = 4 | ||
then: "Add numbers" | ||
sample.addNum(one, two) == "Sum is: 7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.