-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add new bash scripts for test artifacts generation
ci: make flankScripts auto generate jar if needed
- Loading branch information
Showing
10 changed files
with
233 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
project="$(cd "$(pwd)/$(dirname "$BASH_SOURCE")" && pwd)" | ||
|
||
export FLANK_ROOT=$project | ||
export FLANK_FIXTURES_TMP="$project/test_runner/src/test/kotlin/ftl/fixtures/tmp" | ||
|
||
. "$project/test_projects/ops.sh" | ||
|
||
function bash_debug() { | ||
set -euxo pipefail | ||
} |
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,5 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR=`dirname "$BASH_SOURCE"` | ||
dir=$(dirname "$BASH_SOURCE") | ||
scriptsJar="$dir/flankScripts.jar" | ||
|
||
/usr/bin/env java -jar "$DIR/flankScripts.jar" "$@" | ||
if [ ! -f "$scriptsJar" ]; then | ||
"$dir/buildFlankScripts.sh" | ||
fi | ||
|
||
/usr/bin/env java -jar "$scriptsJar" "$@" |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "DEPRECATED!!!" | ||
|
||
set -euxo pipefail | ||
|
||
APK_OUTPUT=$1 | ||
|
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,5 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "DEPRECATED!!!" | ||
|
||
set -euxo pipefail | ||
|
||
DIR=`dirname "$BASH_SOURCE"` | ||
|
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,124 @@ | ||
#!/usr/bin/env bash | ||
|
||
function base_app_apk() { | ||
local dir=$(dirname "$BASH_SOURCE") | ||
local outputDir="$FLANK_FIXTURES_TMP/apk" | ||
|
||
for arg in "$@"; do | ||
case "$arg" in | ||
|
||
'--generate' | '-g') | ||
"$dir/gradlew" -p "$dir" app:assemble | ||
;; | ||
|
||
'--copy' | '-c') | ||
local apkIn="$dir/app/build/outputs/apk/singleSuccess/debug/app-single-success-debug.apk" | ||
local apkOut="$outputDir/app-debug.apk" | ||
|
||
mkdir -p "$outputDir" | ||
cp "$apkIn" "$apkOut" | ||
;; | ||
|
||
esac | ||
done | ||
} | ||
|
||
# depends on base_app_apk | ||
function base_test_apks() { | ||
local dir=$(dirname "$BASH_SOURCE") | ||
|
||
for arg in "$@"; do | ||
case "$arg" in | ||
|
||
'--generate' | '-g') | ||
"$dir/gradlew" -p "$dir" app:assembleAndroidTest | ||
;; | ||
|
||
'--copy' | '-c') | ||
local outputDir="$FLANK_FIXTURES_TMP/apk" | ||
local testIn="$dir/app/build/outputs/apk/androidTest/**/debug/*.apk" | ||
|
||
mkdir -p "$outputDir" | ||
cp $testIn $outputDir/ | ||
;; | ||
|
||
esac | ||
done | ||
} | ||
|
||
# depends on base_app_apk | ||
function duplicated_names_apks() { | ||
local dir=$(dirname "$BASH_SOURCE") | ||
|
||
for arg in "$@"; do | ||
case "$arg" in | ||
|
||
'--generate' | '-g') | ||
"$dir/gradlew" -p "$dir" \ | ||
dir0:testModule:assembleAndroidTest \ | ||
dir1:testModule:assembleAndroidTest \ | ||
dir2:testModule:assembleAndroidTest \ | ||
dir3:testModule:assembleAndroidTest | ||
;; | ||
|
||
'--copy' | '-c') | ||
local outputDir="$FLANK_FIXTURES_TMP/apk" | ||
local testIn="$dir/app/build/outputs/apk/androidTest/**/debug/*.apk" | ||
|
||
mkdir -p "$outputDir" | ||
local dir=$(dirname "$BASH_SOURCE") | ||
local outputDir="$FLANK_FIXTURES_TMP/apk/duplicated_names/" | ||
|
||
for index in 0 1 2 3; do | ||
moduleName="dir$index" | ||
apkDir="$outputDir/$moduleName/" | ||
mkdir -p "$apkDir" | ||
cp "$dir/$moduleName"/testModule/build/outputs/apk/**/debug/*.apk "$apkDir" | ||
done | ||
;; | ||
esac | ||
done | ||
} | ||
|
||
function multi_module_apks() { | ||
local dir=$(dirname "$BASH_SOURCE") | ||
local outputDir="$FLANK_FIXTURES_TMP/apk/multi-modules/" | ||
|
||
for arg in "$@"; do | ||
case "$arg" in | ||
|
||
'--generate' | '-g') | ||
"$dir/gradlew" -p "$dir" \ | ||
:multi-modules:multiapp:assemble \ | ||
:multi-modules:testModule1:assembleAndroidTest \ | ||
:multi-modules:testModule2:assembleAndroidTest \ | ||
:multi-modules:testModule3:assembleAndroidTest \ | ||
:multi-modules:testModule4:assembleAndroidTest \ | ||
:multi-modules:testModule5:assembleAndroidTest \ | ||
:multi-modules:testModule6:assembleAndroidTest \ | ||
:multi-modules:testModule7:assembleAndroidTest \ | ||
:multi-modules:testModule8:assembleAndroidTest \ | ||
:multi-modules:testModule9:assembleAndroidTest \ | ||
:multi-modules:testModule10:assembleAndroidTest \ | ||
:multi-modules:testModule11:assembleAndroidTest \ | ||
:multi-modules:testModule12:assembleAndroidTest \ | ||
:multi-modules:testModule13:assembleAndroidTest \ | ||
:multi-modules:testModule14:assembleAndroidTest \ | ||
:multi-modules:testModule15:assembleAndroidTest \ | ||
:multi-modules:testModule16:assembleAndroidTest \ | ||
:multi-modules:testModule17:assembleAndroidTest \ | ||
:multi-modules:testModule18:assembleAndroidTest \ | ||
:multi-modules:testModule19:assembleAndroidTest \ | ||
:multi-modules:testModule20:assembleAndroidTest | ||
;; | ||
|
||
'--copy' | '-c') | ||
mkdir -p "$outputDir" | ||
find "$dir/multi-modules" -type f -name "*.apk" -exec cp {} "$outputDir" \; | ||
;; | ||
|
||
esac | ||
done | ||
} | ||
|
||
echo "Android test projects ops loaded" |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ Pods/ | |
Podfile.lock | ||
xcuserdata/ | ||
*.xcworkspace/ | ||
dd_tmp |
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,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
function setup_ios_env() { | ||
local dir=$(dirname "$BASH_SOURCE") | ||
gem install cocoapods | ||
cd "$dir" | ||
pod install | ||
} | ||
|
||
function earl_grey_example() { | ||
local dir=$(dirname "$BASH_SOURCE") | ||
for arg in "$@"; do | ||
case "$arg" in | ||
|
||
'--generate' | '-g') | ||
"$dir/build_example.sh" | ||
;; | ||
|
||
'--copy' | '-c') | ||
echo "TODO" | ||
;; | ||
|
||
esac | ||
done | ||
} | ||
|
||
function earl_grey_ftl() { | ||
local dir=$(dirname "$BASH_SOURCE") | ||
for arg in "$@"; do | ||
case "$arg" in | ||
|
||
'--generate' | '-g') | ||
"$dir/build_ftl.sh" | ||
;; | ||
|
||
'--copy' | '-c') | ||
echo "--copy TODO" | ||
;; | ||
|
||
esac | ||
done | ||
} | ||
|
||
function universal_framework() { | ||
local dir=$(dirname "$BASH_SOURCE") | ||
"$dir/universal_framework.sh" | ||
} | ||
|
||
echo "iOS test projects ops loaded" |
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,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
dir="$(dirname "$BASH_SOURCE")" | ||
|
||
. "$dir/android/ops.sh" | ||
. "$dir/ios/EarlGreyExample/ops.sh" | ||
|
||
function update_test_artifacts() { | ||
|
||
for arg in "$@"; do | ||
case "$arg" in | ||
|
||
android) | ||
base_app_apk --generate --copy | ||
base_test_apks --generate --copy | ||
;; | ||
|
||
ios) | ||
setup_ios_env | ||
earl_grey_example --generate --copy | ||
;; | ||
|
||
go) | ||
echo "TODO" | ||
;; | ||
|
||
all) | ||
update_test_artifacts android ios go | ||
;; | ||
esac | ||
done | ||
} |
2 changes: 1 addition & 1 deletion
2
test_runner/src/test/kotlin/ftl/fixtures/test_app_cases/flank-multiple-duplicated.yml
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