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

ci(nix): Setup a head build for the cross_compatibility integ test #4567

Merged
merged 22 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
42 changes: 42 additions & 0 deletions nix/install_s2n_head.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

set -eu

usage() {
echo "install_s2n_head.sh build_dir"
exit 1
}

if [ "$#" -ne "1" ]; then
usage
fi

BUILD_DIR=$1
cd "$SRC_ROOT"

if [[ ! -x "$SRC_ROOT/build/bin/s2nc_head" ]]; then
if [[ ! -d "s2n_head" ]]; then
# Clone the most recent s2n commit
git clone --branch main --single-branch . s2n_head
fi
cmake ./s2n_head -B$BUILD_DIR -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=on -DBUILD_TESTING=on
cmake --build $BUILD_DIR -- -j $(nproc)

# Copy new executables to bin directory
cp -f "$BUILD_DIR"/bin/s2nc "$SRC_ROOT"/build/bin/s2nc_head
cp -f "$BUILD_DIR"/bin/s2nd "$SRC_ROOT"/build/bin/s2nd_head
fi

exit 0
11 changes: 4 additions & 7 deletions nix/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ function build {
banner "Running Build"
javac tests/integrationv2/bin/SSLSocketClient.java
cmake --build ./build -j $(nproc)
#Build s2n from HEAD
$SRC_ROOT/nix/install_s2n_head.sh $(mktemp -d)
}

function unit {
Expand All @@ -60,21 +62,16 @@ function unit {
function integ {
if [ "$1" == "help" ]; then
echo "The following tests are not supported:"
echo " - cross_compatibility"
echo " This test depends on s2nc_head and s2nd_head. To run"
echo " the test build s2n-tls from the main branch on github."
echo " Change the names of s2n[cd] to s2n[cd]_head and add those"
echo " binaries to \$PATH."
echo "- renegotiate_apache"
echo " This test requires apache to be running. See codebuild/bin/s2n_apache.sh"
echo " for more info."
return
fi
if [[ -z "$1" ]]; then
banner "Running all integ tests except cross_compatibility, renegotiate_apache."
banner "Running all integ tests except renegotiate_apache."
(cd $SRC_ROOT/build; ctest -L integrationv2 -E "(integrationv2_cross_compatibility|integrationv2_renegotiate_apache)" --verbose)
else
banner "Warning: cross_compatibility & renegotiate_apache are not supported in nix for various reasons integ help for more info."
banner "Warning: renegotiate_apache is not supported in nix for various reasons integ help for more info."
for test in $@; do
ctest --test-dir ./build -L integrationv2 --no-tests=error --output-on-failure -R "$test" --verbose
if [ "$?" -ne 0 ]; then
Expand Down
Loading