From 12313f758c5c771f513ff0ccfefd3b0135bfa236 Mon Sep 17 00:00:00 2001 From: JeremyEastham <34139712+JeremyEastham@users.noreply.github.com> Date: Sat, 16 Apr 2022 19:23:53 -0500 Subject: [PATCH 1/8] Add IntelliJ IDEA Run Configurations - Add "Load Modules" run configuration for `./loadModules` - Add "Run All Tests" run configuration for `./startTestingEnv` - Add "Start Testing Environment" run configuration for `./startTestingEnv --wait` --- .idea/runConfigurations.xml | 10 ++++++++++ .idea/runConfigurations/Load_Modules.xml | 17 +++++++++++++++++ .idea/runConfigurations/Run_All_Tests.xml | 17 +++++++++++++++++ .../Start_Testing_Environment.xml | 17 +++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 .idea/runConfigurations.xml create mode 100644 .idea/runConfigurations/Load_Modules.xml create mode 100644 .idea/runConfigurations/Run_All_Tests.xml create mode 100644 .idea/runConfigurations/Start_Testing_Environment.xml diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..797acea --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Load_Modules.xml b/.idea/runConfigurations/Load_Modules.xml new file mode 100644 index 0000000..43fa883 --- /dev/null +++ b/.idea/runConfigurations/Load_Modules.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Run_All_Tests.xml b/.idea/runConfigurations/Run_All_Tests.xml new file mode 100644 index 0000000..95ddcbf --- /dev/null +++ b/.idea/runConfigurations/Run_All_Tests.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Start_Testing_Environment.xml b/.idea/runConfigurations/Start_Testing_Environment.xml new file mode 100644 index 0000000..39f8de3 --- /dev/null +++ b/.idea/runConfigurations/Start_Testing_Environment.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file From b793ec95129c12717835b90a11e3cf232f9ce412 Mon Sep 17 00:00:00 2001 From: Jeremy E <34139712+JeremyEastham@users.noreply.github.com> Date: Sat, 16 Apr 2022 19:54:25 -0500 Subject: [PATCH 2/8] Update messages echoed by the `startTestingEnv` script --- startTestingEnv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/startTestingEnv b/startTestingEnv index 283f6da..a3168f8 100755 --- a/startTestingEnv +++ b/startTestingEnv @@ -31,13 +31,15 @@ fi if [[ $wait = "true" ]] then + echo "Test environment started! Leave this script running while running tests." # we wait for user to end the session while [[ true ]] do - echo "Running test env" + echo "Test environment running..." sleep 2 done else + echo "Running all tests..." # ../ because the tests are run relative to the project's folder. ./gradlew test fi From 39e45b46e67d4072c3058106500240e81be612e8 Mon Sep 17 00:00:00 2001 From: Jeremy E <34139712+JeremyEastham@users.noreply.github.com> Date: Thu, 21 Apr 2022 00:41:22 -0500 Subject: [PATCH 3/8] Add "Lint" run configuration for `./gradlew spotlessApply` --- .idea/misc.xml | 1 + .idea/runConfigurations/Lint.xml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .idea/runConfigurations/Lint.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index 318caae..4dcad84 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,6 @@ + diff --git a/.idea/runConfigurations/Lint.xml b/.idea/runConfigurations/Lint.xml new file mode 100644 index 0000000..e464fa1 --- /dev/null +++ b/.idea/runConfigurations/Lint.xml @@ -0,0 +1,21 @@ + + + + + + + true + true + false + + + \ No newline at end of file From 611b27cb764f1ac66b2ca0c40b6df5d733c10167 Mon Sep 17 00:00:00 2001 From: Jeremy E <34139712+JeremyEastham@users.noreply.github.com> Date: Thu, 21 Apr 2022 00:46:16 -0500 Subject: [PATCH 4/8] Delete dev env utility scripts --- utils/cleanDevEnv | 10 ---- utils/setupDevEnv | 150 ---------------------------------------------- 2 files changed, 160 deletions(-) delete mode 100755 utils/cleanDevEnv delete mode 100755 utils/setupDevEnv diff --git a/utils/cleanDevEnv b/utils/cleanDevEnv deleted file mode 100755 index 7f9bc79..0000000 --- a/utils/cleanDevEnv +++ /dev/null @@ -1,10 +0,0 @@ -rm -rf core -rm -rf plugin-interface -rm -rf plugin -rm -rf cli -rm -rf downloader -rm version.yaml -rm config.yaml -rm install -rm install.bat -rm LICENSE.md \ No newline at end of file diff --git a/utils/setupDevEnv b/utils/setupDevEnv deleted file mode 100755 index a641fdb..0000000 --- a/utils/setupDevEnv +++ /dev/null @@ -1,150 +0,0 @@ -./gradlew clean -> version_temp.yaml -> config_temp.yaml - -prefix=`./utils/project-prefix` - -# add new line char at the end in case it's not there for looping -echo >> modules.txt - -# looping -cat modules.txt | while read line -do - if [[ ! -z "$line" ]] && [[ $line != //* ]] - then - while IFS=',' read -ra ADDR; do - counter=0 - for i in "${ADDR[@]}"; do - if [ $counter == 0 ] - then - repo_name="$i" - fi - counter=$(($counter+1)) - done - done <<< "$line" - - dir_name=$prefix-$repo_name - - if [[ $repo_name != "sqlite-plugin" ]] - then - # build - echo "" - echo "Building $dir_name..." - (cd $dir_name/ && ./runBuild noJarFolderChange) - fi - - # move jars to relevant place for testing - - if [[ $dir_name = *"-core" ]] - then - (cd $dir_name/cli/ && ./runBuild noJarFolderChange) - (cd $dir_name/downloader/ && ./runBuild noJarFolderChange) - mkdir core > /dev/null 2>&1 - cp $dir_name/build/libs/* core - cp $dir_name/build/dependencies/* core > /dev/null 2>&1 - - # add to version_temp.yaml - core_version=`cat $dir_name/build.gradle | grep -e "version =" -e "version="` - while IFS='"' read -ra ADDR; do - counter=0 - for i in "${ADDR[@]}"; do - if [ $counter == 1 ] - then - core_version=$i - fi - counter=$(($counter+1)) - done - done <<< "$core_version" - echo "core_version: $core_version" >> version_temp.yaml - - mkdir cli > /dev/null 2>&1 - cp $dir_name/cli/build/libs/* cli - cp $dir_name/cli/build/dependencies/* cli > /dev/null 2>&1 - - mkdir downloader > /dev/null 2>&1 - cp $dir_name/downloader/build/libs/* downloader - - cp $dir_name/install install - cp $dir_name/install.bat install.bat - - cp $dir_name/LICENSE.md LICENSE.md - elif [[ $dir_name = *"-plugin-interface" ]] - then - mkdir plugin-interface > /dev/null 2>&1 - cp $dir_name/build/libs/* plugin-interface - cp $dir_name/build/dependencies/* plugin-interface > /dev/null 2>&1 - - # add to version_temp.yaml - pi_version=`cat $dir_name/build.gradle | grep -e "version =" -e "version="` - while IFS='"' read -ra ADDR; do - counter=0 - for i in "${ADDR[@]}"; do - if [ $counter == 1 ] - then - pi_version=$i - fi - counter=$(($counter+1)) - done - done <<< "$pi_version" - echo "plugin_interface_version: $pi_version" >> version_temp.yaml - - elif [[ $repo_name != "sqlite-plugin" ]] - then - mkdir plugin > /dev/null 2>&1 - cp $dir_name/build/libs/* plugin - cp $dir_name/build/dependencies/* plugin > /dev/null 2>&1 - - - # add to version_temp.yaml - p_version=`cat $dir_name/build.gradle | grep -e "version =" -e "version="` - while IFS='"' read -ra ADDR; do - counter=0 - for i in "${ADDR[@]}"; do - if [ $counter == 1 ] - then - p_version=$i - fi - counter=$(($counter+1)) - done - done <<< "$p_version" - p_name=`cat $dir_name/build.gradle | grep -e "def pluginName =" -e "def pluginName="` - while IFS='"' read -ra ADDR; do - counter=0 - for i in "${ADDR[@]}"; do - if [ $counter == 1 ] - then - p_name=$i - fi - counter=$(($counter+1)) - done - done <<< "$p_name" - echo "plugin_version: $p_version" >> version_temp.yaml - echo "plugin_name: $p_name" >> version_temp.yaml - else - mkdir plugin > /dev/null 2>&1 - fi - - - # populate config file - - if [[ $dir_name = *"-core" ]] - then - cat $dir_name/devConfig.yaml >> config_temp.yaml - echo "" >> config_temp.yaml - echo "" >> config_temp.yaml - elif [[ $dir_name = *"-plugin-interface" ]] - then - continue=1 - elif [[ $repo_name != "sqlite-plugin" ]] - then - cat $dir_name/devConfig.yaml >> config_temp.yaml - `echo ""` >> config_temp.yaml - fi - fi -done - -# remove new line char from end for next use of this script -printf %s "$(< modules.txt)" > modules.txt - -mv version_temp.yaml version.yaml -mv config_temp.yaml config.yaml \ No newline at end of file From 2a4cf72304a1b3e8769f43e4a55c348b6e728e28 Mon Sep 17 00:00:00 2001 From: Jeremy E <34139712+JeremyEastham@users.noreply.github.com> Date: Thu, 21 Apr 2022 15:06:38 -0500 Subject: [PATCH 5/8] Add `#!/bin/bash` to all scripts --- utils/addDevTag | 1 + utils/addReleaseTag | 1 + utils/cleanTestEnvCicd | 1 + utils/cleanTestEnvLocal | 1 + utils/createConfigFileForTesting | 2 +- utils/setupTestEnvCicd | 1 + utils/setupTestEnvLocal | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/utils/addDevTag b/utils/addDevTag index 7a6851f..6efd047 100755 --- a/utils/addDevTag +++ b/utils/addDevTag @@ -1,3 +1,4 @@ +#!/bin/bash # check if we need to merge master into this branch------------ if [[ $(git log origin/master ^HEAD) ]]; then echo "You need to merge master into this branch. Exiting" diff --git a/utils/addReleaseTag b/utils/addReleaseTag index b13eda2..38591ef 100755 --- a/utils/addReleaseTag +++ b/utils/addReleaseTag @@ -1,3 +1,4 @@ +#!/bin/bash # working directory is inside supertokens-*/. Expects a releasePassword file to be ../ # ./addReleaseTag [--forced] # get version------------ diff --git a/utils/cleanTestEnvCicd b/utils/cleanTestEnvCicd index a6e26ce..2777958 100755 --- a/utils/cleanTestEnvCicd +++ b/utils/cleanTestEnvCicd @@ -1,3 +1,4 @@ +#!/bin/bash rm -rf core rm -rf plugin-interface rm -rf plugin diff --git a/utils/cleanTestEnvLocal b/utils/cleanTestEnvLocal index a6e26ce..2777958 100755 --- a/utils/cleanTestEnvLocal +++ b/utils/cleanTestEnvLocal @@ -1,3 +1,4 @@ +#!/bin/bash rm -rf core rm -rf plugin-interface rm -rf plugin diff --git a/utils/createConfigFileForTesting b/utils/createConfigFileForTesting index 1c702dd..6020423 100755 --- a/utils/createConfigFileForTesting +++ b/utils/createConfigFileForTesting @@ -1,4 +1,4 @@ - +#!/bin/bash > config_temp.yaml prefix=`./utils/project-prefix` diff --git a/utils/setupTestEnvCicd b/utils/setupTestEnvCicd index 6c20cfc..1bcaf2a 100755 --- a/utils/setupTestEnvCicd +++ b/utils/setupTestEnvCicd @@ -1,3 +1,4 @@ +#!/bin/bash # load version and jars # setup jars, dependencies and version diff --git a/utils/setupTestEnvLocal b/utils/setupTestEnvLocal index f978d80..2da57a0 100755 --- a/utils/setupTestEnvLocal +++ b/utils/setupTestEnvLocal @@ -1,3 +1,4 @@ +#!/bin/bash # setup jars, dependencies and version ./gradlew clean From fc59568a27abde4b461423bb2bebb86d7ea82d88 Mon Sep 17 00:00:00 2001 From: Jeremy E <34139712+JeremyEastham@users.noreply.github.com> Date: Thu, 21 Apr 2022 15:08:38 -0500 Subject: [PATCH 6/8] Add support for `.testEnvRunning` file --- utils/cleanTestEnvCicd | 3 ++- utils/cleanTestEnvLocal | 3 ++- utils/setupTestEnvCicd | 3 ++- utils/setupTestEnvLocal | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/utils/cleanTestEnvCicd b/utils/cleanTestEnvCicd index 2777958..c50bf2a 100755 --- a/utils/cleanTestEnvCicd +++ b/utils/cleanTestEnvCicd @@ -8,4 +8,5 @@ rm version.yaml rm -rf temp rm install rm install.bat -rm LICENSE.md \ No newline at end of file +rm LICENSE.md +rm .testEnvRunning \ No newline at end of file diff --git a/utils/cleanTestEnvLocal b/utils/cleanTestEnvLocal index 2777958..c50bf2a 100755 --- a/utils/cleanTestEnvLocal +++ b/utils/cleanTestEnvLocal @@ -8,4 +8,5 @@ rm version.yaml rm -rf temp rm install rm install.bat -rm LICENSE.md \ No newline at end of file +rm LICENSE.md +rm .testEnvRunning \ No newline at end of file diff --git a/utils/setupTestEnvCicd b/utils/setupTestEnvCicd index 1bcaf2a..ab42d72 100755 --- a/utils/setupTestEnvCicd +++ b/utils/setupTestEnvCicd @@ -156,4 +156,5 @@ mv version_temp.yaml version.yaml ./utils/createConfigFileForTesting mkdir temp cp config.yaml temp/config.yaml -rm config.yaml \ No newline at end of file +rm config.yaml +touch .testEnvRunning \ No newline at end of file diff --git a/utils/setupTestEnvLocal b/utils/setupTestEnvLocal index 2da57a0..f43dbe0 100755 --- a/utils/setupTestEnvLocal +++ b/utils/setupTestEnvLocal @@ -139,4 +139,5 @@ mv version_temp.yaml version.yaml ./utils/createConfigFileForTesting mkdir temp cp config.yaml temp/config.yaml -rm config.yaml \ No newline at end of file +rm config.yaml +touch .testEnvRunning \ No newline at end of file From db2cf0d1507c6676e7cb64c97429fbfed42cbf7b Mon Sep 17 00:00:00 2001 From: Jeremy E <34139712+JeremyEastham@users.noreply.github.com> Date: Thu, 21 Apr 2022 15:13:25 -0500 Subject: [PATCH 7/8] Use `touch [file]` instead of `> [file]` in scripts --- utils/createConfigFileForTesting | 2 +- utils/setupTestEnvCicd | 2 +- utils/setupTestEnvLocal | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/createConfigFileForTesting b/utils/createConfigFileForTesting index 6020423..3de76ca 100755 --- a/utils/createConfigFileForTesting +++ b/utils/createConfigFileForTesting @@ -1,5 +1,5 @@ #!/bin/bash -> config_temp.yaml +touch config_temp.yaml prefix=`./utils/project-prefix` diff --git a/utils/setupTestEnvCicd b/utils/setupTestEnvCicd index ab42d72..b594ac7 100755 --- a/utils/setupTestEnvCicd +++ b/utils/setupTestEnvCicd @@ -3,7 +3,7 @@ # setup jars, dependencies and version ./gradlew clean -> version_temp.yaml +touch version_temp.yaml prefix=`./utils/project-prefix` diff --git a/utils/setupTestEnvLocal b/utils/setupTestEnvLocal index f43dbe0..3fcd128 100755 --- a/utils/setupTestEnvLocal +++ b/utils/setupTestEnvLocal @@ -2,7 +2,7 @@ # setup jars, dependencies and version ./gradlew clean -> version_temp.yaml +touch version_temp.yaml prefix=`./utils/project-prefix` From 2f6c59299be099604c6ed668a0f7692587154dab Mon Sep 17 00:00:00 2001 From: Jeremy E <34139712+JeremyEastham@users.noreply.github.com> Date: Fri, 22 Apr 2022 02:53:46 -0500 Subject: [PATCH 8/8] Add `runConfigurations.xml` to `.gitignore` --- .gitignore | 3 +++ .idea/runConfigurations.xml | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) delete mode 100644 .idea/runConfigurations.xml diff --git a/.gitignore b/.gitignore index 956c0bb..c2d33ed 100644 --- a/.gitignore +++ b/.gitignore @@ -97,6 +97,9 @@ LICENSE.md .idea/**/uiDesigner.xml .idea/**/dbnavigator.xml +# Other files +.idea/runConfigurations.xml + # Gradle .idea/**/gradle.xml .idea/**/libraries diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file