Add custom e2e test activation to include the toolchain libs (#1130)

This commit is contained in:
andrejtonev 2023-08-01 17:13:47 +02:00 committed by GitHub
parent 60f4ffc6a1
commit fd819cd099
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 8 deletions

View File

@ -267,8 +267,8 @@ jobs:
- name: Run e2e tests
run: |
cd tests
./setup.sh
source ve3/bin/activate
./setup.sh /opt/toolchain-v4/activate
source ve3/bin/activate_e2e
cd e2e
./run.sh

View File

@ -266,8 +266,8 @@ jobs:
- name: Run e2e tests
run: |
cd tests
./setup.sh
source ve3/bin/activate
./setup.sh /opt/toolchain-v4/activate
source ve3/bin/activate_e2e
cd e2e
./run.sh

View File

@ -265,8 +265,8 @@ jobs:
- name: Run e2e tests
run: |
cd tests
./setup.sh
source ve3/bin/activate
./setup.sh /opt/toolchain-v4/activate
source ve3/bin/activate_e2e
cd e2e
./run.sh

View File

@ -265,8 +265,8 @@ jobs:
- name: Run e2e tests
run: |
cd tests
./setup.sh
source ve3/bin/activate
./setup.sh /opt/toolchain-v4/activate
source ve3/bin/activate_e2e
cd e2e
./run.sh

View File

@ -49,3 +49,46 @@ popd > /dev/null
deactivate
"$DIR"/e2e/graphql/setup.sh
# Check if setup needs to setup additional variables
if [ $# == 1 ]; then
toolchain=$1
if [ -f "$toolchain" ]; then
# Get the LD_LIB from toolchain
set +u
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
source $toolchain
NEW_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
deactivate
set -u
# Wrapper used to setup the correct libraries
tee -a ve3/bin/activate_e2e <<EOF
#!/bin/bash
# Function to set the environment variable
set_env_variable() {
export LD_LIBRARY_PATH=$NEW_LD_LIBRARY_PATH
}
# Function to activate the virtual environment and set the environment variable
activate_e2e() {
source ve3/bin/activate
set_env_variable
}
# Function to deactivate the virtual environment and unset the environment variable
deactivate_e2e() {
deactivate
export LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH
}
# Activate the virtual environment and set the environment variable
activate_e2e
EOF
chmod +x ve3/bin/activate_e2e
else
echo "Error: The toolchain virtual enviroonment activation is not a file."
fi
fi