Skip to content

Commit eb441ff

Browse files
rabbahdgrove-oss
authored andcommitted
Replace zip/jar artifacts with source. (#4763)
Removed binary files which seem to have no references in this repo. Added README and tooling for building needed test binaries from source.
1 parent a686356 commit eb441ff

38 files changed

+434
-36
lines changed

.gitignore

+12-8
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,18 @@ ansible/roles/invoker/files/*
7272

7373
# .zip files must be explicited whitelisted
7474
*.zip
75-
!tests/dat/actions/blackbox.zip
76-
!tests/dat/actions/helloSwift.zip
77-
!tests/dat/actions/python.zip
78-
!tests/dat/actions/python2_virtualenv.zip
79-
!tests/dat/actions/python3_virtualenv.zip
80-
!tests/dat/actions/python_virtualenv_dir.zip
81-
!tests/dat/actions/python_virtualenv_name.zip
82-
!tests/dat/actions/zippedaction.zip
75+
tests/dat/actions/zippedaction/node_modules
76+
tests/dat/actions/sleep.jar
77+
tests/dat/actions/blackbox.zip
78+
tests/dat/actions/python.zip
79+
tests/dat/actions/zippedaction.zip
80+
tests/dat/actions/zippedaction/node_modules
81+
tests/dat/actions/python2_virtualenv.zip
82+
tests/dat/actions/python_virtualenv/virtualenv
83+
tests/dat/actions/.built
84+
tests/dat/actions/unicode.tests/java-8.bin
85+
tests/performance/gatling_tests/src/gatling/resources/data/javaAction.jar
86+
tests/performance/gatling_tests/.built
8387

8488
# dev
8589
intellij-run-config.groovy

tests/build.gradle

+7
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,17 @@ task createKeystore(dependsOn: deleteKeystore) {
233233
}
234234
}
235235

236+
task buildArtifacts(type:Exec) {
237+
workingDir 'dat/actions'
238+
commandLine './build.sh'
239+
}
240+
236241
tasks.withType(Test) {
237242
dependsOn createKeystore
243+
dependsOn buildArtifacts
238244
}
239245
createKeystore.mustRunAfter(testClasses)
246+
buildArtifacts.mustRunAfter(testClasses)
240247

241248
gradle.projectsEvaluated {
242249
task testCoverageLean(type: Test) {

tests/dat/actions/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!--
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
-->
19+
20+
### Building test artifacts
21+
22+
Some test artifacts should be build ahead of actually running the tests.
23+
These test artifacts compile source code into binaries, generate JAR files,
24+
install modules and package functions into zip files.
25+
26+
A `build.sh` script is availble as a convenience and will run ahead of tests
27+
when using `gradle`. However this script will not work on Windows as it currently
28+
assumes Bash is available.
29+
30+
Some artifacts are not build because they require additional tooling.
31+
Specifically, these are the unicode tests for the Ballerina and .NET runtimes.
32+
These unicode tests are checked however in their corresponding runtime build.
33+
34+
For Java artifacts, Java 8 is required. If not found in your path, the build
35+
script will skip those artifacts and corresponding tests will also be skipped.
36+

tests/dat/actions/blackbox.zip

-256 Bytes
Binary file not shown.

tests/dat/actions/blackbox/exec

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
echo 'This is an example zip used with the docker skeleton action.'
20+
echo '{ "msg": "hello zip" }'

tests/dat/actions/build.sh

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
set -e
20+
21+
if [ -f ".built" ]; then
22+
echo "Test zip artifacts already built, skipping"
23+
exit 0
24+
fi
25+
26+
# need java 8 to build java actions since that's the version of the runtime currently
27+
jv=$(java -version 2>&1 | head -1 | awk -F'"' '{print $2}')
28+
if [[ $jv == 1.8.* ]]; then
29+
echo "java version is $jv (ok)"
30+
(cd unicode.tests/src/java/unicode && ../../../../../../../gradlew build && cp build/libs/unicode-1.0.jar ../../../java-8.bin)
31+
(cd src/java/sleep && ../../../../../../gradlew build && cp build/libs/sleep-1.0.jar ../../../sleep.jar)
32+
else
33+
echo "java version is $jv (not ok)"
34+
echo "skipping java actions"
35+
fi
36+
37+
(cd blackbox && zip ../blackbox.zip exec)
38+
(cd python-zip && zip ../python.zip -r .)
39+
(cd zippedaction && npm install && zip ../zippedaction.zip -r .)
40+
(cd python_virtualenv && ./build.sh && zip ../python2_virtualenv.zip -r .)
41+
42+
touch .built

tests/dat/actions/helloJava.jar

-1.06 KB
Binary file not shown.
-1.26 KB
Binary file not shown.

tests/dat/actions/helloSwift311.zip

-1.71 MB
Binary file not shown.

tests/dat/actions/multiSwift.zip

-611 Bytes
Binary file not shown.

tests/dat/actions/python.zip

-726 Bytes
Binary file not shown.
-3.48 MB
Binary file not shown.
-3.91 MB
Binary file not shown.
-3.63 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env python
2+
"""Python Hello virtualenv test.
3+
4+
/*
5+
* Licensed to the Apache Software Foundation (ASF) under one or more
6+
* contributor license agreements. See the NOTICE file distributed with
7+
* this work for additional information regarding copyright ownership.
8+
* The ASF licenses this file to You under the Apache License, Version 2.0
9+
* (the "License"); you may not use this file except in compliance with
10+
* the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
"""
21+
22+
import netifaces
23+
24+
def main(dict):
25+
networkif = netifaces.interfaces()
26+
print ("Networkinterfaces: \n %s" %networkif )
27+
networkinfo = netifaces.ifaddresses('eth0')[netifaces.AF_INET]
28+
print ("Networkinfo eth0: \n %s" %networkinfo )
29+
return {"Networkinfo: ": networkinfo}
30+
31+
def naim(dict):
32+
return main(dict)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
virtualenv virtualenv
20+
source virtualenv/bin/activate
21+
pip install -r requirements.txt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
netifaces==0.10.9
-807 Bytes
Binary file not shown.
-586 KB
Binary file not shown.

tests/dat/actions/sleep.jar

-1.14 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
plugins {
19+
id 'java'
20+
}
21+
22+
version = '1.0'
23+
24+
repositories {
25+
mavenCentral()
26+
}
27+
28+
dependencies {
29+
compile "com.google.code.gson:gson:2.6.2"
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
rootProject.name = 'sleep'
Binary file not shown.
-661 KB
Binary file not shown.
-996 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
rootProject.name = 'unicode'

tests/dat/actions/zippedaction.zip

-50.7 KB
Binary file not shown.
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
function entryPoint(args) {
19+
var pq = require("prog-quote")();
20+
21+
return pq.next().value;
22+
}
23+
24+
exports.main = entryPoint;

tests/dat/actions/zippedaction/package-lock.json

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "test-action",
3+
"version": "1.0.0",
4+
"description": "An action written as an npm package.",
5+
"main": "index.js",
6+
"author": "OpenWhisk",
7+
"license": "Apache 2.0",
8+
"dependencies": {
9+
"prog-quote": "2.0.0"
10+
}
11+
}

tests/performance/gatling_tests/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ dependencies {
2525
gatling "io.spray:spray-json_${gradle.scala.depVersion}:1.3.4"
2626
gatling "commons-io:commons-io:2.6"
2727
}
28+
29+
task buildArtifacts(type:Exec) {
30+
commandLine './build.sh'
31+
}
32+
33+
tasks.matching {it != buildArtifacts}.all {it.dependsOn buildArtifacts}
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
set -e
20+
21+
if [ -f ".built" ]; then
22+
echo "Test zip artifacts already built, skipping"
23+
exit 0
24+
fi
25+
26+
# need java 8 to build java actions since that's the version of the runtime currently
27+
jv=$(java -version 2>&1 | head -1 | awk -F'"' '{print $2}')
28+
if [[ $jv == 1.8.* ]]; then
29+
echo "java version is $jv (ok)"
30+
(cd src/gatling/resources/data/src/java && ../../../../../../../../../gradlew build && cp build/libs/gatling-1.0.jar ../../javaAction.jar)
31+
touch .built
32+
else
33+
echo "java version is $jv (not ok)"
34+
echo "skipping java actions"
35+
fi
Binary file not shown.

0 commit comments

Comments
 (0)