Clean up gitaction env and add tag for pytest

1. Add docker prune cmd to release some space;
2. Add tag for pytest in case of debugging requirement;
3. Replace image to smaller size in robot account pytest;

Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2020-04-20 17:16:02 +08:00
parent e93bd75d38
commit fdded0744a
4 changed files with 33 additions and 3 deletions

View File

@ -71,7 +71,7 @@ class TestProjects(unittest.TestCase):
image_project_a = "haproxy" image_project_a = "haproxy"
image_project_b = "hello-world" image_project_b = "hello-world"
image_project_c = "httpd" image_project_c = "httpd"
image_robot_account = "mariadb" image_robot_account = "alpine"
tag = "latest" tag = "latest"
print "#1. Create user(UA);" print "#1. Create user(UA);"

View File

@ -4,6 +4,7 @@ set -x
set +e set +e
sudo rm -fr /data/* sudo rm -fr /data/*
sudo mkdir -p /data sudo mkdir -p /data
docker system prune -a -f
DIR="$(cd "$(dirname "$0")" && pwd)" DIR="$(cd "$(dirname "$0")" && pwd)"
set -e set -e

View File

@ -28,10 +28,13 @@ function uploader {
set +e set +e
docker ps docker ps
# Log storage space before running API_DB.robot
df -H
# run db auth api cases # run db auth api cases
if [ "$1" = 'DB' ]; then if [ "$1" = 'DB' ]; then
pybot -X -v ip:$2 -v HARBOR_PASSWORD:Harbor12345 $DIR/../../tests/robot-cases/Group0-BAT/API_DB.robot pybot -X -v ip:$2 -v HARBOR_PASSWORD:Harbor12345 $DIR/../../tests/robot-cases/Group0-BAT/API_DB.robot
# Log storage space after running API_DB.robot
df -H
elif [ "$1" = 'LDAP' ]; then elif [ "$1" = 'LDAP' ]; then
# run ldap api cases # run ldap api cases
python $DIR/../../tests/configharbor.py -H $IP -u $HARBOR_ADMIN -p $HARBOR_ADMIN_PASSWD -c auth_mode=ldap_auth \ python $DIR/../../tests/configharbor.py -H $IP -u $HARBOR_ADMIN -p $HARBOR_ADMIN_PASSWD -c auth_mode=ldap_auth \

View File

@ -18,54 +18,80 @@ ${SERVER_API_ENDPOINT} ${SERVER_URL}/api
*** Test Cases *** *** Test Cases ***
Test Case - Garbage Collection Test Case - Garbage Collection
[Tags] gc
Harbor API Test ./tests/apitests/python/test_garbage_collection.py Harbor API Test ./tests/apitests/python/test_garbage_collection.py
Test Case - Add Private Project Member and Check User Can See It Test Case - Add Private Project Member and Check User Can See It
[Tags] private_member
Harbor API Test ./tests/apitests/python/test_add_member_to_private_project.py Harbor API Test ./tests/apitests/python/test_add_member_to_private_project.py
Test Case - Delete a Repository of a Certain Project Created by Normal User Test Case - Delete a Repository of a Certain Project Created by Normal User
[Tags] del_repo
Harbor API Test ./tests/apitests/python/test_del_repo.py Harbor API Test ./tests/apitests/python/test_del_repo.py
Test Case - Add a System Global Label to a Certain Tag Test Case - Add a System Global Label to a Certain Tag
[Tags] global_lbl
Harbor API Test ./tests/apitests/python/test_add_sys_label_to_tag.py Harbor API Test ./tests/apitests/python/test_add_sys_label_to_tag.py
Test Case - Add Replication Rule Test Case - Add Replication Rule
[Tags] replic_rule
Harbor API Test ./tests/apitests/python/test_add_replication_rule.py Harbor API Test ./tests/apitests/python/test_add_replication_rule.py
Test Case - Edit Project Creation Test Case - Edit Project Creation
[Tags] pro_creation
Harbor API Test ./tests/apitests/python/test_edit_project_creation.py Harbor API Test ./tests/apitests/python/test_edit_project_creation.py
Test Case - Manage Project Member Test Case - Manage Project Member
[Tags] member
Harbor API Test ./tests/apitests/python/test_manage_project_member.py Harbor API Test ./tests/apitests/python/test_manage_project_member.py
Test Case - Project Level Policy Content Trust Test Case - Project Level Policy Content Trust
[Tags] content_trust
Harbor API Test ./tests/apitests/python/test_project_level_policy_content_trust.py Harbor API Test ./tests/apitests/python/test_project_level_policy_content_trust.py
Test Case - User View Logs Test Case - User View Logs
[Tags] view_logs
Harbor API Test ./tests/apitests/python/test_user_view_logs.py Harbor API Test ./tests/apitests/python/test_user_view_logs.py
Test Case - List Helm Charts Test Case - List Helm Charts
[Tags] list_helm_charts
Harbor API Test ./tests/apitests/python/test_list_helm_charts.py Harbor API Test ./tests/apitests/python/test_list_helm_charts.py
Test Case - Assign Sys Admin Test Case - Assign Sys Admin
[Tags] assign_adin
Harbor API Test ./tests/apitests/python/test_assign_sys_admin.py Harbor API Test ./tests/apitests/python/test_assign_sys_admin.py
Test Case - Copy Artifact Outside Project Test Case - Copy Artifact Outside Project
[Tags] copy_artifact
Harbor API Test ./tests/apitests/python/test_copy_artifact_outside_project.py Harbor API Test ./tests/apitests/python/test_copy_artifact_outside_project.py
Test Case - Robot Account Test Case - Robot Account
[Tags] robot_account
Harbor API Test ./tests/apitests/python/test_robot_account.py Harbor API Test ./tests/apitests/python/test_robot_account.py
Test Case - Sign A Image Test Case - Sign A Image
[Tags] sign_image
Harbor API Test ./tests/apitests/python/test_sign_image.py Harbor API Test ./tests/apitests/python/test_sign_image.py
Test Case - Project Quota Test Case - Project Quota
[Tags] quota
Harbor API Test ./tests/apitests/python/test_project_quota.py Harbor API Test ./tests/apitests/python/test_project_quota.py
Test Case - System Level CVE Whitelist Test Case - System Level CVE Whitelist
[Tags] sys_cve
Harbor API Test ./tests/apitests/python/test_sys_cve_whitelists.py Harbor API Test ./tests/apitests/python/test_sys_cve_whitelists.py
Test Case - Project Level CVE Whitelist Test Case - Project Level CVE Whitelist
[Tags] pro_cve
Harbor API Test ./tests/apitests/python/test_project_level_cve_whitelist.py Harbor API Test ./tests/apitests/python/test_project_level_cve_whitelist.py
Test Case - Tag Retention Test Case - Tag Retention
[Tags] tag_retention
Harbor API Test ./tests/apitests/python/test_retention.py Harbor API Test ./tests/apitests/python/test_retention.py
Test Case - Health Check Test Case - Health Check
[Tags] health
Harbor API Test ./tests/apitests/python/test_health_check.py Harbor API Test ./tests/apitests/python/test_health_check.py
Test Case - Push Index By Docker Manifest Test Case - Push Index By Docker Manifest
[Tags] push_index
Harbor API Test ./tests/apitests/python/test_push_index_by_docker_manifest.py Harbor API Test ./tests/apitests/python/test_push_index_by_docker_manifest.py
Test Case - Push Chart By Helm3 Chart CLI Test Case - Push Chart By Helm3 Chart CLI
[Tags] push_chart
Harbor API Test ./tests/apitests/python/test_push_chart_by_helm3_chart_cli.py Harbor API Test ./tests/apitests/python/test_push_chart_by_helm3_chart_cli.py
Test Case - Push Cnab Bundle Test Case - Push Cnab Bundle
[Tags] push_cnab
Harbor API Test ./tests/apitests/python/test_push_cnab_bundle.py Harbor API Test ./tests/apitests/python/test_push_cnab_bundle.py
Test Case - Create/Delete tag Test Case - Create/Delete tag
[Tags] tag_cuid
Harbor API Test ./tests/apitests/python/test_create_delete_tag.py Harbor API Test ./tests/apitests/python/test_create_delete_tag.py
Test Case - Scan Image Test Case - Scan Image
[Tags] scan
Harbor API Test ./tests/apitests/python/test_scan_image_artifact.py Harbor API Test ./tests/apitests/python/test_scan_image_artifact.py
Test Case - Scan All Images Test Case - Scan All Images
[Tags] scan_all
Harbor API Test ./tests/apitests/python/test_system_level_scan_all.py Harbor API Test ./tests/apitests/python/test_system_level_scan_all.py
Test Case - Registry API Test Case - Registry API
[Tags] reg_api
Harbor API Test ./tests/apitests/python/test_registry_api.py Harbor API Test ./tests/apitests/python/test_registry_api.py