Skip to content

Commit

Permalink
Add test for named no-skip-current and fix filtering of currentMap
Browse files Browse the repository at this point in the history
  • Loading branch information
tmspzz committed Feb 5, 2019
1 parent 322596a commit 1311264
Show file tree
Hide file tree
Showing 6 changed files with 396 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
os: osx
language: objective-c
osx_image: xcode9.4
osx_image: xcode10.1

git:
depth: 1
Expand Down
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (4.2.10)
activesupport (4.2.11)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
Expand Down Expand Up @@ -50,10 +50,10 @@ GEM
cocoapods-try (1.1.0)
coderay (1.1.2)
colored2 (3.1.2)
concurrent-ruby (1.1.3)
concurrent-ruby (1.1.4)
cork (0.3.0)
colored2 (~> 3.1)
danger (5.8.0)
danger (5.11.1)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
Expand All @@ -70,7 +70,7 @@ GEM
danger-plugin-api (1.0.0)
danger (> 2.0)
escape (0.0.4)
faraday (0.15.3)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
faraday-http-cache (1.3.1)
faraday (~> 0.8)
Expand All @@ -81,7 +81,7 @@ GEM
i18n (0.9.5)
concurrent-ruby (~> 1.0)
kramdown (1.17.0)
method_source (0.9.1)
method_source (0.9.2)
minitest (5.11.3)
molinillo (0.6.6)
multipart-post (2.0.0)
Expand All @@ -92,7 +92,7 @@ GEM
octokit (4.13.0)
sawyer (~> 0.8.0, >= 0.5.3)
open4 (1.3.4)
pry (0.12.0)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (3.0.3)
Expand All @@ -105,7 +105,7 @@ GEM
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.4.0)
unicode-display_width (1.4.1)
xcodeproj (1.7.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
Expand All @@ -123,4 +123,4 @@ DEPENDENCIES
pry

BUNDLED WITH
1.16.2
1.17.3
258 changes: 258 additions & 0 deletions integration-tests/current-framework-named-yaml.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
#!/usr/bin/env bats

setup() {

export FRAMEWORK_VERSION=0.2.0
export FRAMEWORK_REPO_NAME=swift-tagged
export FRAMEWORK_ARTIFACT_NAME=Tagged

cd $BATS_TMPDIR

rm -rf Rome-Tests

mkdir Rome-Tests && cd Rome-Tests

git clone https://github.com/pointfreeco/swift-tagged.git
cd swift-tagged
git checkout ${FRAMEWORK_VERSION}

if [ "$BATS_TEST_NUMBER" -eq 1 ]; then

carthage build --no-use-binaries --no-skip-current --cache-builds

rm -rf ../../_Carthage_build_bkp
cp -R Carthage/Build/ ../../_Carthage_build_bkp

else
mkdir -p Carthage/Build
cp -R ../../_Carthage_build_bkp/ Carthage/Build
fi

cat >> Romefile << EOF
cache:
local: rome-local-cache
s3Bucket: rome
ignoreMap:
- swift-tagged:
- name: Tagged
platforms: [Mac]
currentMap:
- swift-tagged:
- name: Tagged
EOF

mkdir -p ~/.aws
printf "[default]\n region = us-east-1" >> ~/.aws/config

# minio

mkdir -p minio-buckets/rome

IOS_DWARFDUMP_OUT=($(dwarfdump -u Carthage/Build/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework/${FRAMEWORK_ARTIFACT_NAME}))
TVOS_DWARFDUMP_OUT=($(dwarfdump -u Carthage/Build/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework/${FRAMEWORK_ARTIFACT_NAME}))
WATCHOS_DWARFDUMP_OUT=($(dwarfdump -u Carthage/Build/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework/${FRAMEWORK_ARTIFACT_NAME}))

export IOS_ARMV7_DWARF_UUID=${IOS_DWARFDUMP_OUT[9]}
export IOS_ARM64_DWARF_UUID=${IOS_DWARFDUMP_OUT[13]}
export TVOS_ARM64_DWARF_UUID=${TVOS_DWARFDUMP_OUT[5]}
export WATCHOS_ARMV7K_DWARF_UUID=${WATCHOS_DWARFDUMP_OUT[5]}

export AWS_ACCESS_KEY_ID=Q3AM3UQ867SPQQA43P2F
export AWS_SECRET_ACCESS_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
export MINIO_ACCESS_KEY=Q3AM3UQ867SPQQA43P2F
export MINIO_SECRET_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
export AWS_ENDPOINT=http://127.0.0.1:9000

echo "# BATS_TMPDIR: ${BATS_TMPDIR}" >&3

}

teardown() {

if [ ! "$BATS_TEST_NUMBER" -eq 3 ]; then
killall minio
fi
cd $BATS_TEST_DIRNAME
}


@test "rome uploads all named artifacts for current framework (dynamic, yaml)" {

# Test 1

MINIO_HTTP_TRACE=output.log minio server minio-buckets &
sleep 4

ls
echo `pwd`

run rome upload --cache-prefix travis ${FRAMEWORK_REPO_NAME}

[ "$status" -eq 0 ]

if [ -d "minio-buckets/rome" ]; then
cp -R minio-buckets/rome/ ../../_rome_bkp
fi

# Version file
# [ -f "minio-buckets/rome/travis/Alamofire/.Alamofire.version-4.7.3" ]
# [ -f "rome-local-cache/travis/Alamofire/.Alamofire.version-4.7.3" ]

# macOS - No bitecode, No bcsymbolmap
[ ! -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework-${FRAMEWORK_VERSION}.zip" ]
[ ! -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM-${FRAMEWORK_VERSION}.zip" ]
[ ! -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework-${FRAMEWORK_VERSION}.zip" ]
[ ! -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM-${FRAMEWORK_VERSION}.zip" ]

# iOS
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework-${FRAMEWORK_VERSION}.zip" ]
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM-${FRAMEWORK_VERSION}.zip" ]
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/iOS/${IOS_ARMV7_DWARF_UUID}.bcsymbolmap-${FRAMEWORK_VERSION}.zip" ]
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/iOS/${IOS_ARM64_DWARF_UUID}.bcsymbolmap-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/iOS/${IOS_ARMV7_DWARF_UUID}.bcsymbolmap-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/iOS/${IOS_ARM64_DWARF_UUID}.bcsymbolmap-${FRAMEWORK_VERSION}.zip" ]

# tvOS
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework-${FRAMEWORK_VERSION}.zip" ]
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM-${FRAMEWORK_VERSION}.zip" ]
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/tvOS/${TVOS_ARM64_DWARF_UUID}.bcsymbolmap-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/tvOS/${TVOS_ARM64_DWARF_UUID}.bcsymbolmap-${FRAMEWORK_VERSION}.zip" ]

# watchOS
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework-${FRAMEWORK_VERSION}.zip" ]
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM-${FRAMEWORK_VERSION}.zip" ]
[ -f "minio-buckets/rome/travis/${FRAMEWORK_REPO_NAME}/watchOS/${WATCHOS_ARMV7K_DWARF_UUID}.bcsymbolmap-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM-${FRAMEWORK_VERSION}.zip" ]
[ -f "rome-local-cache/travis/${FRAMEWORK_REPO_NAME}/watchOS/${WATCHOS_ARMV7K_DWARF_UUID}.bcsymbolmap-${FRAMEWORK_VERSION}.zip" ]

#save the local cache for later

rm -rf ../../_rome-local-cache_bkp
cp -R rome-local-cache/ ../../_rome-local-cache_bkp

}

@test "rome downloads all named artifacts for current framework skipping local cache (dynamic, yaml)" {

# Test 2

if [ -d "../../_rome_bkp" ]; then
echo "# Minio bucket restored" >&3
cp -R ../../_rome_bkp/ minio-buckets/rome
fi

MINIO_HTTP_TRACE=output.log minio server minio-buckets &
sleep 4

rm -rf Carthage/Build
run rome download --cache-prefix travis --skip-local-cache ${FRAMEWORK_REPO_NAME}

[ "$status" -eq 0 ]

# Version file
# [ -f "Carthage/Build/.Alamofire.version" ]

# macOS - No bitcode, No bcsymbolmap
[ ! -d "Carthage/Build/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ ! -d "Carthage/Build/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]

# iOS
[ -d "Carthage/Build/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ -d "Carthage/Build/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]
[ -f "Carthage/Build/iOS/${IOS_ARMV7_DWARF_UUID}.bcsymbolmap" ]
[ -f "Carthage/Build/iOS/${IOS_ARM64_DWARF_UUID}.bcsymbolmap" ]

# tvOS
[ -d "Carthage/Build/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ -d "Carthage/Build/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]
[ -f "Carthage/Build/tvOS/${TVOS_ARM64_DWARF_UUID}.bcsymbolmap" ]

# watchOS
[ -d "Carthage/Build/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ -d "Carthage/Build/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]
[ -f "Carthage/Build/watchOS/${WATCHOS_ARMV7K_DWARF_UUID}.bcsymbolmap" ]
}

@test "rome downloads all named artifacts for current framework from the local cache (dynamic, yaml)" {

# Test 3

if [ -d "../../_rome-local-cache_bkp" ]; then
echo "# Rome local cache restored" >&3
cp -R ../../_rome-local-cache_bkp/ rome-local-cache
fi

rm -rf Carthage/Build
run rome download --cache-prefix travis ${FRAMEWORK_REPO_NAME}

[ "$status" -eq 0 ]

# Version file
# [ -e "Carthage/Build/.Alamofire.version" ]

# macOS - No bitecode, No bcsymbolmap
[ ! -d "Carthage/Build/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ ! -d "Carthage/Build/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]

# iOS
[ -d "Carthage/Build/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ -d "Carthage/Build/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]
[ -f "Carthage/Build/iOS/${IOS_ARMV7_DWARF_UUID}.bcsymbolmap" ]
[ -f "Carthage/Build/iOS/${IOS_ARM64_DWARF_UUID}.bcsymbolmap" ]

# tvOS
[ -d "Carthage/Build/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ -d "Carthage/Build/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]
[ -f "Carthage/Build/tvOS/${TVOS_ARM64_DWARF_UUID}.bcsymbolmap" ]

# watchOS
[ -d "Carthage/Build/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ -d "Carthage/Build/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]
[ -f "Carthage/Build/watchOS/${WATCHOS_ARMV7K_DWARF_UUID}.bcsymbolmap" ]
}

@test "rome downloads named artifacts for current framework skipping local cache (dynamic, yaml)" {

# Test 4

if [ -d "../../_rome_bkp" ]; then
echo "# Minio bucket restored" >&3
cp -R ../../_rome_bkp/ minio-buckets/rome
fi

MINIO_HTTP_TRACE=output.log minio server minio-buckets &
sleep 4

rm -rf Carthage/Build
run rome download --cache-prefix travis --skip-local-cache ${FRAMEWORK_REPO_NAME}

[ "$status" -eq 0 ]

# Version file
# [ -f "Carthage/Build/.Alamofire.version" ]

# macOS - No bitcode, No bcsymbolmap
[ ! -d "Carthage/Build/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ ! -d "Carthage/Build/Mac/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]

# iOS
[ -d "Carthage/Build/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ -d "Carthage/Build/iOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]
[ -f "Carthage/Build/iOS/${IOS_ARMV7_DWARF_UUID}.bcsymbolmap" ]
[ -f "Carthage/Build/iOS/${IOS_ARM64_DWARF_UUID}.bcsymbolmap" ]

# tvOS
[ -d "Carthage/Build/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ -d "Carthage/Build/tvOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]
[ -f "Carthage/Build/tvOS/${TVOS_ARM64_DWARF_UUID}.bcsymbolmap" ]

# watchOS
[ -d "Carthage/Build/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework" ]
[ -d "Carthage/Build/watchOS/${FRAMEWORK_ARTIFACT_NAME}.framework.dSYM" ]
[ -f "Carthage/Build/watchOS/${WATCHOS_ARMV7K_DWARF_UUID}.bcsymbolmap" ]
}
Loading

0 comments on commit 1311264

Please sign in to comment.