Skip to content

Comments

Add e2e tests#88

Open
osmanhadzic wants to merge 1 commit intoastarte-platform:masterfrom
osmanhadzic:end2endtests
Open

Add e2e tests#88
osmanhadzic wants to merge 1 commit intoastarte-platform:masterfrom
osmanhadzic:end2endtests

Conversation

@osmanhadzic
Copy link

Add end-to-end test for:

Send property from device to server and from server to device
Send Datastream from device to server and from server to device
Send Aggregate data from device to server and from server to device

Closes: #54

Copy link
Collaborator

@lucaato lucaato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed some files, let me know what you think about the comments.

Signed-off-by: Osman Hadzic <osman.hadzic@secomind.com>
Comment on lines +69 to +74
sudo openssl s_client -connect api.autotest.astarte-platform.org:443 -showcerts </dev/null 2>/dev/null|openssl x509 -outform PEM > ${GITHUB_WORKSPACE}/astarte-certificates.pem
openssl x509 -outform der -in ${GITHUB_WORKSPACE}/astarte-certificates.pem -out ${GITHUB_WORKSPACE}/astarte-certificates.der
echo $JAVA_HOME
KEYSTORE_PATH=$JAVA_HOME/lib/security/cacerts
sudo keytool -import -noprompt -trustcacerts -alias "astarteroot-cert" -file ${GITHUB_WORKSPACE}/astarte-certificates.der -keystore $KEYSTORE_PATH -storepass changeit
sudo keytool -keystore $KEYSTORE_PATH -storepass changeit -list | grep astarteroot-cert
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be simplified, I don't think you need to generate a new certificate. A valid certificate is already generated at the /usr/local/share/ca-certificates/astarte-autotest.crt path by the astarte-cluster-action. You should be able to import this one directly in the jvm key store.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a lot of problems when I tried to create an end-to-end test for Java. The problem was related to SSL certification because our master branch does not have a flag to avoid SSL errors. I found a solution to fix the error. The solution was to add the SSL key to the JVM.

@lucaato
Copy link
Collaborator

lucaato commented Dec 23, 2024

There are also a number of exception thrown and logged in the e2e test build and run step, you should probably take a look at those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants