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

run bashtubs as part of the CI #4578

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions buildkite/pipelines/bacalhau-golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ steps:
agents:
queue: "buildkite-hosted-linux-large"

- label: ":testengine: Bash Tub Test"
command: "./buildkite/scripts/bash_tub_test.sh"
key: "bash-tub-test"
agents:
queue: "buildkite-hosted-linux-large"

- wait: ~

- label: ":docker: Build & Publish Bacalhau Image"
Expand Down
22 changes: 22 additions & 0 deletions buildkite/scripts/bash_tub_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -e

build_bacalhau() {
make build
}


bash_test() {
make bash-test
}


main () {
build_bacalhau
bash_test
}

main


2 changes: 1 addition & 1 deletion pkg/config/types/default_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var Default = Bacalhau{
},
NameProvider: "puuid",
Orchestrator: Orchestrator{
Enabled: false,
Enabled: true,
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately we can't change this default.

Host: "0.0.0.0",
Port: 4222,
NodeManager: NodeManager{
Expand Down
12 changes: 11 additions & 1 deletion test/bin/bacalhau.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ clean_repo() {
create_node() {
TYPE=$1
shift 1
$BACALHAU serve --node-type=$TYPE $@ 1>$BACALHAU_DIR/out.log 2>$BACALHAU_DIR/err.log &

# Check if TYPE contains a comma
if [[ "$TYPE" == *","* ]]; then
# Split the types and run the command with both
IFS=',' read -ra TYPES <<< "$TYPE"
$BACALHAU serve --"${TYPES[0]}" --"${TYPES[1]}" "$@" 1>$BACALHAU_DIR/out.log 2>$BACALHAU_DIR/err.log &
else
# Run the command with the single type
$BACALHAU serve --"$TYPE" "$@" 1>$BACALHAU_DIR/out.log 2>$BACALHAU_DIR/err.log &
fi

NODE_PID=$!
RUNNING_NODES+=($NODE_PID)
{
Expand Down
Empty file modified test/config_with_defaults.sh
100644 → 100755
Empty file.
Empty file modified test/config_with_file.sh
100644 → 100755
Empty file.
Empty file modified test/config_with_file_override.sh
100644 → 100755
Empty file.
Empty file modified test/config_with_file_override_and_flag.sh
100644 → 100755
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we are removing these tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't know how you got that it is being deleted. It is updating chmod permission to allow it to run

Empty file.
2 changes: 1 addition & 1 deletion test/config_with_file_override_and_flag_and_config_flag.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source bin/bacalhau.sh

testcase_config_with_override_config_file_with_api_config_flag_and_dedicated_flag() {
start_bacalhau_serve_with_config -c $ROOT/testdata/config/base.yaml -c $ROOT/testdata/config/override.yaml --web-ui=false --config webui.enabled=true
start_bacalhau_serve_with_config -c $ROOT/testdata/config/base.yaml -c $ROOT/testdata/config/override.yaml --config webui.enabled=true

subject curl -s http://localhost:1234/api/v1/agent/config
assert_equal 0 $status > /dev/null
Expand Down
4 changes: 2 additions & 2 deletions test/errors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
source bin/bacalhau.sh

testcase_ranking_failures_are_printed() {
create_node compute,requester
create_node compute,orchestrator

subject bacalhau job run $ROOT/testdata/jobs/custom-task-type.yaml
assert_match 'does not support flibble' $(echo $stderr)
assert_match 'does not support flibble' $(echo $stdout)
}
2 changes: 1 addition & 1 deletion test/get-results.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source bin/bacalhau.sh

testcase_can_get_results() {
# Assuming create_node is a function that takes two arguments separated by space, not comma
create_node requester,compute
create_node orchestrator,compute

job_id=$(bacalhau job run --id-only $ROOT/testdata/jobs/docker-output.yaml)
bacalhau job get $job_id > /dev/null 2>&1
Expand Down
2 changes: 1 addition & 1 deletion test/hello-world-docker-v2.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source bin/bacalhau.sh

testcase_can_run_docker_hello_world() {
# Assuming create_node is a function that takes two arguments separated by comma, not space
create_node requester,compute
create_node orchestrator,compute

subject bacalhau job run --follow $ROOT/testdata/jobs/docker-hello.yaml
assert_equal 0 $status
Expand Down
4 changes: 2 additions & 2 deletions test/labels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ run_test() {
}

testcase_receive_labels_about_requester_node() {
run_test requester
run_test orchestrator
}

testcase_receive_labels_about_compute_node() {
run_test requester,compute
run_test orchestrator,compute
}
2 changes: 1 addition & 1 deletion test/list_nodes.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source bin/bacalhau.sh

testcase_can_list_nodes_and_count() {
create_node requester,compute
create_node orchestrator,compute

subject bacalhau node list --output json
assert_equal 0 $status
Expand Down
2 changes: 1 addition & 1 deletion test/logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source bin/bacalhau.sh

testcase_can_follow_job_logs() {
create_node requester,compute
create_node orchestrator,compute

subject bacalhau job run --follow $ROOT/testdata/jobs/wasm.yaml
assert_equal 0 $status
Expand Down
10 changes: 5 additions & 5 deletions test/node_auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source bin/bacalhau.sh

testcase_node_can_connect_without_token() {
subject bacalhau config set node.network.type nats
create_node requester
create_node orchestrator

create_node compute
# If this returns successfully, the node started and authenticated.
Expand All @@ -15,7 +15,7 @@ testcase_preconfigured_token_not_printed() {
subject bacalhau config set node.network.authsecret kerfuffle
assert_equal 0 $status

create_node requester
create_node orchestrator
assert_equal 0 $status

# check stdout
Expand All @@ -33,7 +33,7 @@ testcase_node_connects_with_preconfigured_token() {
subject bacalhau config set node.network.type nats
subject bacalhau config set node.network.authsecret kerfuffle
assert_match 0 $status
create_node requester
create_node orchestrator

subject bacalhau config set node.network.authsecret kerfuffle
subject bacalhau config set node.network.type nats
Expand All @@ -45,7 +45,7 @@ testcase_node_connects_with_url_embedded_token() {
subject bacalhau config set node.network.type nats
subject bacalhau config set node.network.authsecret kerfuffle
assert_match 0 $status
create_node requester
create_node orchestrator


# remove the token from the config
Expand All @@ -63,7 +63,7 @@ testcase_node_cannot_connect_with_wrong_token() {
subject bacalhau config set node.network.type nats
subject bacalhau config set node.network.authsecret kerfuffle
assert_match 0 $status
create_node requester
create_node orchestrator

subject bacalhau config set node.network.type nats
subject bacalhau config set node.network.authsecret kerfalafel
Expand Down
2 changes: 1 addition & 1 deletion test/secret_auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ setup() {
subject 'bacalhau config list | grep auth.methods'
assert_match 'shared_secret' $stdout

create_node requester
create_node orchestrator

subject ls $BACALHAU_DIR/tokens.json
assert_not_equal 0 $status
Expand Down
Loading