Skip to content

Commit

Permalink
unit test + e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Navid Yaghoobi <[email protected]>
  • Loading branch information
navidys committed Mar 4, 2024
1 parent 1eb658d commit 42629ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ jobs:
make .install.bats
make binary
./bin/prometheus-podman-exporter --collector.enable-all --collector.store_labels &
echo "starting e2e"
make test-e2e
echo "stopping e2e"
build_binary:
runs-on: ubuntu-latest
Expand Down
16 changes: 8 additions & 8 deletions test/006-container.bats
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ load helpers
exit
fi

# podman container create --name $TEST_CNT_LABEL --label label01=value01 $TEST_BUSYBOX_IMAGE
# cnt_id=$(podman container inspect $TEST_CNT_LABEL -f "{{ .Id }}")

# curl -s $METRICS_URL | grep "podman_container_info{id=\"${cnt_id:0:12}\",image=\"$TEST_BUSYBOX_IMAGE:latest\",label01=\"value01\",name=\"$TEST_CNT_LABEL\",pod_id=\"\",pod_name=\"\",ports=\"\"} 1"
# if [ $? -ne 0 ] ; then
# false
# exit
# fi
podman container create --name $TEST_CNT_LABEL --label label01=value01 $TEST_BUSYBOX_IMAGE
cnt_id=$(podman container inspect $TEST_CNT_LABEL -f "{{ .Id }}")

curl -s $METRICS_URL | grep "podman_container_info{id=\"${cnt_id:0:12}\",image=\"$TEST_BUSYBOX_IMAGE:latest\",label01=\"value01\",name=\"$TEST_CNT_LABEL\",pod_id=\"\",pod_name=\"\",ports=\"\"} 1"
if [ $? -ne 0 ] ; then
false
exit
fi

true
}

0 comments on commit 42629ec

Please sign in to comment.