Skip to content

Commit

Permalink
Merge pull request #171 from singnet/angelo/#161/fixing-attention-bro…
Browse files Browse the repository at this point in the history
…ker-tests
  • Loading branch information
angeloprobst authored Jan 10, 2025
2 parents 88e4793 + 34b8910 commit 3efd7fd
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/cpp/tests/das_node_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ TEST(DASNode, queries) {

cout << "XXXXXXXXXXXXXXXX DASNode.queries BEGIN" << endl;

setenv("DAS_REDIS_HOSTNAME", "ninjato", 1);
setenv("DAS_REDIS_HOSTNAME", "localhost", 1);
setenv("DAS_REDIS_PORT", "29000", 1);
setenv("DAS_USE_REDIS_CLUSTER", "false", 1);
setenv("DAS_MONGODB_HOSTNAME", "ninjato", 1);
setenv("DAS_MONGODB_HOSTNAME", "localhost", 1);
setenv("DAS_MONGODB_PORT", "28000", 1);
setenv("DAS_MONGODB_USERNAME", "dbadmin", 1);
setenv("DAS_MONGODB_PASSWORD", "dassecret", 1);
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/tests/iterator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ TEST(Iterator, basics) {

TEST(Iterator, link_template_integration) {

setenv("DAS_REDIS_HOSTNAME", "ninjato", 1);
setenv("DAS_REDIS_HOSTNAME", "localhost", 1);
setenv("DAS_REDIS_PORT", "29000", 1);
setenv("DAS_USE_REDIS_CLUSTER", "false", 1);
setenv("DAS_MONGODB_HOSTNAME", "ninjato", 1);
setenv("DAS_MONGODB_HOSTNAME", "localhost", 1);
setenv("DAS_MONGODB_PORT", "28000", 1);
setenv("DAS_MONGODB_USERNAME", "dbadmin", 1);
setenv("DAS_MONGODB_PASSWORD", "dassecret", 1);
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/tests/link_template_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ using namespace query_element;

TEST(LinkTemplate, basics) {

setenv("DAS_REDIS_HOSTNAME", "ninjato", 1);
setenv("DAS_REDIS_HOSTNAME", "localhost", 1);
setenv("DAS_REDIS_PORT", "29000", 1);
setenv("DAS_USE_REDIS_CLUSTER", "false", 1);
setenv("DAS_MONGODB_HOSTNAME", "ninjato", 1);
setenv("DAS_MONGODB_HOSTNAME", "localhost", 1);
setenv("DAS_MONGODB_PORT", "28000", 1);
setenv("DAS_MONGODB_USERNAME", "dbadmin", 1);
setenv("DAS_MONGODB_PASSWORD", "dassecret", 1);
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/tests/nested_link_template_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ using namespace query_element;

TEST(LinkTemplate, basics) {

setenv("DAS_REDIS_HOSTNAME", "ninjato", 1);
setenv("DAS_REDIS_HOSTNAME", "localhost", 1);
setenv("DAS_REDIS_PORT", "29000", 1);
setenv("DAS_USE_REDIS_CLUSTER", "false", 1);
setenv("DAS_MONGODB_HOSTNAME", "ninjato", 1);
setenv("DAS_MONGODB_HOSTNAME", "localhost", 1);
setenv("DAS_MONGODB_PORT", "28000", 1);
setenv("DAS_MONGODB_USERNAME", "dbadmin", 1);
setenv("DAS_MONGODB_PASSWORD", "dassecret", 1);
Expand Down
15 changes: 13 additions & 2 deletions src/scripts/bazel_test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#!/bin/bash
#!/bin/bash -x

(( JOBS=$(nproc)/2 ))
BAZELISK_CMD=/opt/bazel/bazelisk
REPO_ROOT=/opt/das-attention-broker
WORKSPACE_DIR=${REPO_ROOT}/cpp

cd $WORKSPACE_DIR
$BAZELISK_CMD test \
--jobs $JOBS \
--noenable_bzlmod \
--cache_test_results=no \
//...

bazel test --noenable_bzlmod --cache_test_results=no //...
3 changes: 3 additions & 0 deletions src/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

IMAGE_NAME="das-attention-broker-builder"
CONTAINER_NAME=${IMAGE_NAME}-container
LOCAL_CACHE=/tmp/bazel_cache
mkdir -p $LOCAL_CACHE

docker run --rm \
-e _USER=$(id -u) \
-e _GROUP=$(id -g) \
--name=$CONTAINER_NAME \
--volume $LOCAL_CACHE:/root/.cache/bazel \
--volume .:/opt/das-attention-broker \
--workdir /opt/das-attention-broker \
${IMAGE_NAME} \
Expand Down
16 changes: 10 additions & 6 deletions src/scripts/unit_tests.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#!/bin/bash

CONTAINER_NAME="das-attention-broker-build"
IMAGE_NAME="das-attention-broker-builder"
CONTAINER_NAME=${IMAGE_NAME}-container
LOCAL_CACHE=/tmp/bazel_cache
mkdir -p $LOCAL_CACHE

mkdir -p bin
docker run \
docker run --rm \
-e _USER=$(id -u) \
-e _GROUP=$(id -g) \
--network=host \
--name=$CONTAINER_NAME \
--volume .:/opt/das-attention-broker \
--volume $LOCAL_CACHE:/root/.cache/bazel \
--workdir /opt/das-attention-broker/src \
das-attention-broker-builder \
${IMAGE_NAME} \
../scripts/bazel_test.sh

sleep 1
docker rm $CONTAINER_NAME

0 comments on commit 3efd7fd

Please sign in to comment.