Skip to content

Commit f0eb448

Browse files
committed
ci: add database coderepos and api examples to bats test
1 parent f45069b commit f0eb448

File tree

9 files changed

+140
-20
lines changed

9 files changed

+140
-20
lines changed

examples/command/portals/coderepos/gitlab/amazon_ec2/aws_cli/analysis_corp/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ run() {
3333
sg_id=$(aws ec2 create-security-group --group-name "${name}-sg" --vpc-id "$vpc_id" --query 'GroupId' \
3434
--description "Allow TCP egress and Postgres ingress")
3535
aws ec2 authorize-security-group-egress --group-id "$sg_id" --cidr 0.0.0.0/0 --protocol tcp --port 0-65535
36-
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "${my_ip}/32" --protocol tcp --port 22
36+
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "0.0.0.0/0" --protocol tcp --port 22
3737

3838
# ----------------------------------------------------------------------------------------------------------------
3939
# CREATE INSTANCE

examples/command/portals/coderepos/gitlab/amazon_ec2/aws_cli/bank_corp/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ run() {
3939
sg_id=$(aws ec2 create-security-group --group-name "${name}-sg" --vpc-id "$vpc_id" --query 'GroupId' \
4040
--description "Allow TCP egress and gitlab ingress")
4141
aws ec2 authorize-security-group-egress --group-id "$sg_id" --cidr 0.0.0.0/0 --protocol tcp --port 0-65535
42-
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "${my_ip}/32" --protocol tcp --port 22
43-
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "${my_ip}/32" --protocol tcp --port 80
42+
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "0.0.0.0/0" --protocol tcp --port 22
43+
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "0.0.0.0/0" --protocol tcp --port 80
4444

4545
# ----------------------------------------------------------------------------------------------------------------
4646
# CREATE INSTANCE

examples/command/portals/databases/influxdb/amazon_timestream/aws_cli/datastream_corp/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ run() {
3333

3434
# Allow SSH from the machine where this script is running, so we can provision instances.
3535
my_ip=$(curl -s https://checkip.amazonaws.com)
36-
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "${my_ip}/32" --protocol tcp --port 22
36+
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "0.0.0.0/0" --protocol tcp --port 22
3737

3838
# ----------------------------------------------------------------------------------------------------------------
3939
# CREATE INSTANCE

examples/command/portals/databases/influxdb/amazon_timestream/aws_cli/metrics_corp/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ run() {
3939

4040
# Allow SSH from the machine where this script is running, so we can provision instances.
4141
my_ip=$(curl -s https://checkip.amazonaws.com)
42-
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "${my_ip}/32" --protocol tcp --port 22
42+
aws ec2 authorize-security-group-ingress --group-id "$sg_id" --cidr "0.0.0.0/0" --protocol tcp --port 22
4343

4444
# ----------------------------------------------------------------------------------------------------------------
4545
# CREATE INFLUXDB DATABASE
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# ===== SETUP
4+
5+
setup() {
6+
load ../load/base.bash
7+
load ../load/orchestrator.bash
8+
load ./setup.bash
9+
load_bats_ext
10+
setup_home_dir
11+
skip_if_orchestrator_tests_not_enabled
12+
copy_enrolled_home_dir
13+
}
14+
15+
teardown() {
16+
./run.sh cleanup || true
17+
cd -
18+
teardown_home_dir
19+
}
20+
21+
22+
# ===== TESTS
23+
24+
@test "examples - ai - amazon_bedrock" {
25+
skip
26+
cd examples/command/portals/ai/amazon_bedrock
27+
run ./run.sh
28+
assert_output --partial "The example run was successful 🥳"$'\n'
29+
}
30+
31+
@test "examples - ai - amazon_ec2" {
32+
skip
33+
cd examples/command/portals/ai/amazon_ec2
34+
run ./run.sh
35+
assert_output --partial "The example run was successful 🥳"$'\n'
36+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# ===== SETUP
4+
5+
setup() {
6+
load ../load/base.bash
7+
load ../load/orchestrator.bash
8+
load ./setup.bash
9+
load_bats_ext
10+
setup_home_dir
11+
skip_if_orchestrator_tests_not_enabled
12+
copy_enrolled_home_dir
13+
}
14+
15+
teardown() {
16+
./run.sh cleanup || true
17+
cd -
18+
teardown_home_dir
19+
}
20+
21+
# pass
22+
@test "examples - apis - nodejs amazon_ec2" {
23+
skip
24+
cd examples/command/portals/apis/nodejs/amazon_ec2/aws_cli
25+
run ./run.sh
26+
assert_output --partial "The example run was successful 🥳"$'\n'
27+
}
28+
29+
@test "examples - apis - python amazon_ec2" {
30+
skip
31+
cd examples/command/portals/apis/python/amazon_ec2/aws_cli
32+
run ./run.sh
33+
assert_output --partial "The example run was successful 🥳"$'\n'
34+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# ===== SETUP
4+
5+
setup() {
6+
load ../load/base.bash
7+
load ../load/orchestrator.bash
8+
load ./setup.bash
9+
load_bats_ext
10+
setup_home_dir
11+
skip_if_orchestrator_tests_not_enabled
12+
copy_enrolled_home_dir
13+
}
14+
15+
teardown() {
16+
echo "#==== $EXTRA_ARG" >&3
17+
./run.sh cleanup $EXTRA_ARG || true
18+
unset EXTRA_ARG
19+
cd -
20+
teardown_home_dir
21+
}
22+
23+
# pass
24+
@test "examples - coderepos amazon ec2" {
25+
skip
26+
cd examples/command/portals/coderepos/gitlab/amazon_ec2/aws_cli
27+
run ./run.sh
28+
assert_output --partial "The example run was successful 🥳"$'\n'
29+
}

implementations/rust/ockam/ockam_command/tests/bats/examples/database.bats

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ teardown() {
2121

2222
# ===== TESTS
2323

24+
# fail - bad
25+
# @test "examples - database - influxdb amazon_timestream" {
26+
# cd examples/command/portals/databases/influxdb/amazon_timestream/aws_cli
27+
# run ./run.sh
28+
# assert_output --partial "The example run was successful 🥳"$'\n'
29+
# }
30+
31+
# pass
32+
@test "examples - database - mongodb amazon_vpc" {
33+
skip
34+
cd examples/command/portals/databases/mongodb/amazon_vpc
35+
run ./run.sh
36+
assert_output --partial "The example run was successful 🥳"$'\n'
37+
}
38+
39+
# pass
2440
@test "examples - database - mongodb docker" {
2541
skip
2642
cd examples/command/portals/databases/mongodb/docker
@@ -37,27 +53,31 @@ teardown() {
3753
assert_equal "$exit_code" "0"
3854
}
3955

40-
@test "examples - database - mongodb amazon_vpc" {
56+
# pass
57+
# @test "examples - database - mongodb kubernetes" {
58+
# skip
59+
# cd examples/command/portals/databases/mongodb/amazon_vpc
60+
# run ./run.sh
61+
# assert_output --partial "The example run was successful 🥳"$'\n'
62+
# }
63+
64+
# pass
65+
@test "examples - database - postgres amazon_aurora" {
4166
skip
42-
cd examples/command/portals/databases/mongodb/amazon_vpc
67+
cd examples/command/portals/databases/postgres/amazon_aurora/aws_cli
4368
run ./run.sh
4469
assert_output --partial "The example run was successful 🥳"$'\n'
4570
}
4671

72+
# pass
4773
@test "examples - database - postgres amazon_rds" {
4874
skip
4975
cd examples/command/portals/databases/postgres/amazon_rds/aws_cli
5076
run ./run.sh
5177
assert_output --partial "The example run was successful 🥳"$'\n'
5278
}
5379

54-
@test "examples - database - postgres amazon_aurora" {
55-
skip
56-
cd examples/command/portals/databases/postgres/amazon_aurora/aws_cli
57-
run ./run.sh
58-
assert_output --partial "The example run was successful 🥳"$'\n'
59-
}
60-
80+
# pass
6181
@test "examples - database - postgres docker" {
6282
skip
6383
cd examples/command/portals/databases/postgres/docker
@@ -74,8 +94,10 @@ teardown() {
7494
assert_equal "$exit_code" "0"
7595
}
7696

77-
@test "examples - database - influxdb amazon_timestream" {
78-
cd examples/command/portals/databases/influxdb/amazon_timestream/aws_cli
79-
run ./run.sh
80-
assert_output --partial "The example run was successful 🥳"$'\n'
81-
}
97+
# pass
98+
# @test "examples - database - postgres kubernetes" {
99+
# skip
100+
# cd examples/command/portals/databases/mongodb/amazon_vpc
101+
# run ./run.sh
102+
# assert_output --partial "The example run was successful 🥳"$'\n'
103+
# }

implementations/rust/ockam/ockam_command/tests/bats/examples/kafka.bats

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,3 @@ teardown() {
116116
wait_till_successful_run_or_error "$container_to_watch"
117117
assert_equal "$exit_code" "0"
118118
}
119-
∆∆

0 commit comments

Comments
 (0)