Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional unit-tests and unit-test adjustment #611

Merged
merged 76 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
1325ce0
Initial work on refactoring. Is not going to work at all until builde…
TwistedTwigleg Apr 10, 2023
4a68096
Add missing MQTT311 connection tests. Still needs refactoring for exi…
TwistedTwigleg Apr 14, 2023
7d887f6
Add MQTT5 credentials connection tests. Fix MQTT5 not always showing …
TwistedTwigleg Apr 17, 2023
5c43144
Try using the new builder action as a temporary action in this repo
TwistedTwigleg Apr 17, 2023
ed77306
Adjust builder.json to not reference removed action
TwistedTwigleg Apr 17, 2023
c3d4a0e
For temporary testing, hard code the S3 URL in the builder action
TwistedTwigleg Apr 17, 2023
025679f
Fix S3 XML bug
TwistedTwigleg Apr 17, 2023
7b32f06
Use updated builder script
TwistedTwigleg Apr 17, 2023
869b678
Fix Windows Cert builder action
TwistedTwigleg Apr 17, 2023
922fe69
Adjust custom key ops test to only run on Linux again
TwistedTwigleg Apr 17, 2023
d3413cd
Clean up some imports, mainly to trigger CI again
TwistedTwigleg Apr 17, 2023
053f77c
Fix file permissions issue?
TwistedTwigleg Apr 17, 2023
7f3676e
Add MQTT5 Custom Key Ops tests, refactor MQTT311 custom key ops tests
TwistedTwigleg Apr 17, 2023
1106e81
Refactor the IoT Service Test to use new environment variables
TwistedTwigleg Apr 17, 2023
3af62ed
Update to use latest setup_ci_from_files temporary builder action
TwistedTwigleg Apr 19, 2023
ca629df
Use new builder action for CI
TwistedTwigleg Apr 26, 2023
f3d909a
Fix missed import
TwistedTwigleg Apr 26, 2023
f307d6d
Fix fails on Linux trying to use deleted PKCS11 action
TwistedTwigleg Apr 26, 2023
520ba6b
Merge branch 'main' of https://github.com/awslabs/aws-crt-java into u…
TwistedTwigleg Apr 26, 2023
8836ab5
Refactor MQTT5 tests to use new environment variable layout
TwistedTwigleg Apr 26, 2023
b0e41a8
Add MQTT5 Will Test
TwistedTwigleg Apr 26, 2023
39ec73a
Refactor MQTT311 tests to use new environment variables when possible
TwistedTwigleg Apr 26, 2023
8eba9de
Even more MQTT311 related refactoring
TwistedTwigleg Apr 26, 2023
f3f53dc
Use builder in Codebuild to run tests, fix MQTT5 test compile issue
TwistedTwigleg Apr 26, 2023
3071260
Use bash in Codebuild
TwistedTwigleg Apr 26, 2023
e8f90e1
Try building in Debug to see if that helps with Codebuild
TwistedTwigleg Apr 26, 2023
afb72d3
Maybe use --project instead of -p?
TwistedTwigleg Apr 26, 2023
ed96d76
Use new command to ignore coverage to allow builder to run in Codebuild
TwistedTwigleg Apr 26, 2023
1b7d1fc
Bump to trigger CI
TwistedTwigleg Apr 26, 2023
2e2578c
Bump CI again
TwistedTwigleg Apr 26, 2023
a53f6d0
Another bump
TwistedTwigleg Apr 26, 2023
0e5b725
Try using the latest builder commit
TwistedTwigleg Apr 26, 2023
32f68e0
Try again
TwistedTwigleg Apr 26, 2023
c82257c
Is the version of Python too low?
TwistedTwigleg Apr 26, 2023
d7b549c
Install latest Python3
TwistedTwigleg Apr 26, 2023
a458191
Bump CI
TwistedTwigleg Apr 27, 2023
381d913
Skip installing cmake and such, it should already be installed
TwistedTwigleg Apr 27, 2023
c20211a
Skip install step entirely
TwistedTwigleg Apr 27, 2023
6a0765e
Install CMake
TwistedTwigleg Apr 27, 2023
d62c7b0
Do not specify GCC version
TwistedTwigleg Apr 27, 2023
af00d2e
Update the GitHub submodules?
TwistedTwigleg Apr 27, 2023
75941fb
Super minor fix, mainly to bump CI
TwistedTwigleg Apr 27, 2023
f8826b2
Bump to trigger CI
TwistedTwigleg Apr 28, 2023
9cfd801
Bump again for Windows
TwistedTwigleg Apr 28, 2023
b0af84b
Another Windows testing bump. Hopefully the last one
TwistedTwigleg Apr 28, 2023
08e58ea
Windows bump again
TwistedTwigleg Apr 28, 2023
a0fc445
Hopefully latest builder change fixes Windows fully. Also Java Keysto…
TwistedTwigleg Apr 28, 2023
0de2a88
Maybe Windows will like these file paths
TwistedTwigleg Apr 28, 2023
8bdc278
Try with chmod
TwistedTwigleg Apr 28, 2023
29aeaab
Test - is it not the file path?
TwistedTwigleg Apr 28, 2023
7342dea
Adjust TLS test back to how it was and see if that fixes it?
TwistedTwigleg Apr 28, 2023
ff4c853
Fix proxy tests
TwistedTwigleg Apr 28, 2023
e6d59b1
Further proxy adjustments
TwistedTwigleg Apr 28, 2023
7e2ac17
Typo fix in proxy tests
TwistedTwigleg Apr 28, 2023
ea5da51
See if the latest Windows fix helps
TwistedTwigleg Apr 28, 2023
0b1a026
One more Windows bump
TwistedTwigleg Apr 28, 2023
0962501
One more bump just to make sure it is all working for sure
TwistedTwigleg May 1, 2023
b09c87b
Merge branch 'main' of https://github.com/awslabs/aws-crt-java into u…
TwistedTwigleg May 1, 2023
7ae3eaa
Fix merge leftovers
TwistedTwigleg May 1, 2023
35f5bf5
Minor fix for double client ID resource closing
TwistedTwigleg May 1, 2023
c7f4d7d
Missed applying TlsContext to second builder, slightly adjust wait ti…
TwistedTwigleg May 1, 2023
57be931
Try extending double client ID time. Not sure why it is suddenly havi…
TwistedTwigleg May 1, 2023
8547ac6
Fix ECC test
TwistedTwigleg May 1, 2023
ca05be2
Merge branch 'main' of https://github.com/awslabs/aws-crt-java into u…
TwistedTwigleg May 1, 2023
ec7e0e5
PKCS11 does not like multiple imports. Just use the same PKCS11 crede…
TwistedTwigleg May 3, 2023
2c8f9f3
Merge branch 'main' of https://github.com/awslabs/aws-crt-java into u…
TwistedTwigleg May 3, 2023
7b31088
Fix memory leak in PKCS11 credential test
TwistedTwigleg May 3, 2023
93a0154
PKCS11 adjustment
TwistedTwigleg May 3, 2023
6a3d226
Do not leak memory in MQTT311 PKCS11 test either
TwistedTwigleg May 3, 2023
e05dda5
Commit to just bump CI
TwistedTwigleg May 5, 2023
f1b65d7
Merge branch 'main' into unit_test_refactor
TwistedTwigleg May 8, 2023
29debe3
Merge branch 'main' of https://github.com/awslabs/aws-crt-java into u…
TwistedTwigleg May 24, 2023
5856110
Relax the operation statistics test a bit since checking unacked is r…
TwistedTwigleg May 24, 2023
f68409b
CR: use assumeNotNull and clean up comments and code
TwistedTwigleg May 25, 2023
e4e7a0e
Add some delay between reconnect in the double client ID test
TwistedTwigleg May 25, 2023
41b0147
Just remove the reconnect double client ID test - we know reconnect w…
TwistedTwigleg May 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 19 additions & 40 deletions .builder/actions/aws_crt_java_test.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@

import Builder
import sys
import os
import os.path
import tempfile


class AWSCrtJavaTest(Builder.Action):

def _write_secret_to_temp_file(self, secret_name):
secret_value = self.env.shell.get_secret(secret_name)

temp_file = tempfile.NamedTemporaryFile()
temp_file.write(str.encode(secret_value))
temp_file.flush()

return temp_file

def _run_java_tests(self, *cmd_args):
if os.path.exists('log.txt'):
os.remove('log.txt')
Expand All @@ -28,39 +16,22 @@ def _run_java_tests(self, *cmd_args):
with open('log.txt', 'r') as log:
print(log.read())
print("----------------------------------")

sys.exit(f"Tests failed")

def run(self, env):
self.env = env

def start_maven_tests(self, env):
# tests must run with leak detection turned on
env.shell.setenv('AWS_CRT_MEMORY_TRACING', '2')

endpoint = env.shell.get_secret("unit-test/endpoint")

with self._write_secret_to_temp_file("unit-test/rootca") as root_ca_file, \
self._write_secret_to_temp_file("unit-test/certificate") as cert_file, \
self._write_secret_to_temp_file("unit-test/privatekey") as key_file, \
self._write_secret_to_temp_file("ecc-test/certificate") as ecc_cert_file, \
self._write_secret_to_temp_file("ecc-test/privatekey") as ecc_key_file:

self._run_java_tests(
"mvn", "-P", "continuous-integration", "-B", "test",
"-DredirectTestOutputToFile=true",
"-DreuseForks=false",
"-DrerunFailingTestsCount=5",
"-Daws.crt.memory.tracing=2",
"-Daws.crt.debugnative=true",
"-Daws.crt.aws_trace_log_per_test",
"-Daws.crt.ci=true",
f"-Dendpoint={endpoint}",
f"-Drootca={root_ca_file.name}",
f"-Dcertificate={cert_file.name}",
f"-Dprivatekey={key_file.name}",
f"-Decc_certificate={ecc_cert_file.name}",
f"-Decc_privatekey={ecc_key_file.name}",
)
self._run_java_tests(
"mvn", "-P", "continuous-integration", "-B", "test",
"-DredirectTestOutputToFile=true",
"-DreuseForks=false",
"-DrerunFailingTestsCount=5",
"-Daws.crt.memory.tracing=2",
"-Daws.crt.debugnative=true",
"-Daws.crt.aws_trace_log_per_test",
"-Daws.crt.ci=true",
)

# run the ShutdownTest by itself
env.shell.setenv('AWS_CRT_SHUTDOWN_TESTING', '1')
Expand All @@ -79,3 +50,11 @@ def run(self, env):
python = sys.executable
env.shell.exec(python, 'crt/aws-c-http/integration-testing/http_client_test.py',
python, 'integration-testing/java_elasticurl_runner.py', check=True)

def run(self, env):
self.env = env

return Builder.Script([
Builder.SetupCrossCICrtEnvironment(),
self.start_maven_tests # Then run the Maven stuff
])
16 changes: 0 additions & 16 deletions .builder/actions/crt-ci-prep.py

This file was deleted.

174 changes: 0 additions & 174 deletions .builder/actions/pkcs11_test_setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- 'docs'

env:
BUILDER_VERSION: v0.9.43
BUILDER_SOURCE: releases
BUILDER_VERSION: setup_crt_ci_from_action
BUILDER_SOURCE: channels
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-java
LINUX_BASE_IMAGE: ubuntu-18-x64
Expand Down
3 changes: 0 additions & 3 deletions builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"mvn -P continuous-integration -B compile"
],
"test_steps": [
"crt-ci-prep",
"aws-crt-java-test"
],
"+imports": [
Expand Down Expand Up @@ -36,8 +35,6 @@
},
"targets": {
"linux": {
"_comment": "set up SoftHSM2 for PKCS#11 tests (see: ./builder/actions/pkcs11_test_setup.py)",
"+pre_build_steps": ["pkcs11-test-setup"],
"!build_steps": [
"mvn -P continuous-integration -B compile"
],
Expand Down
17 changes: 14 additions & 3 deletions codebuild/linux-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
version: 0.2

env:
shell: bash
variables:
BUILDER_VERSION: setup_crt_ci_from_action
BUILDER_SOURCE: channels
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-java

phases:
install:
commands:
Expand All @@ -9,9 +18,11 @@ phases:
build:
commands:
- echo Build started on `date`
- aws s3 cp s3://aws-crt-test-stuff/setup_proxy_test_env.sh /tmp/setup_proxy_test_env.sh
- sudo chmod a+xr /tmp/setup_proxy_test_env.sh
- $CODEBUILD_SRC_DIR/codebuild/common-linux.sh
# Update the submodules
- git submodule update --init
# Build library and test
- python3 -c "from urllib.request import urlretrieve; urlretrieve('$BUILDER_HOST/$BUILDER_SOURCE/$BUILDER_VERSION/builder.pyz?run=$CODEBUILD_BUILD_ID', 'builder.pyz')"
- python3 builder.pyz build --project aws-crt-java downstream
post_build:
commands:
- echo Build completed on `date`
Loading