Skip to content

Commit 03d59f6

Browse files
authored
Merge pull request #9146 from nadavMiz/single-test-doc
update single tests variable names and docs to reflect change to path
2 parents 176b00b + bae3f2c commit 03d59f6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ ifeq ($(USE_HOSTNETWORK), true)
7373
endif
7474

7575
# running blob mock on - all tests run OR on single test run of test_s3_ops.js
76-
NAMESPACE_BLOB_TEST?="test_s3_ops.js"
76+
NAMESPACE_BLOB_TEST?="integration_tests/api/s3/test_s3_ops.js"
7777
RUN_BLOB_MOCK=true
78-
ifdef testname
79-
ifneq ("$(testname)", $(NAMESPACE_BLOB_TEST))
78+
ifdef testpath
79+
ifneq ("$(testpath)", $(NAMESPACE_BLOB_TEST))
8080
RUN_BLOB_MOCK=false
8181
endif
8282
endif
@@ -280,7 +280,7 @@ run-single-test: tester
280280
@$(call run_mongo)
281281
@$(call run_blob_mock)
282282
@echo "\033[1;34mRunning tests\033[0m"
283-
$(CONTAINER_ENGINE) run $(CPUSET) --network noobaa-net --name noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX) --env "SUPPRESS_LOGS=$(SUPPRESS_LOGS)" --env "DB_TYPE=mongodb" --env "MONGODB_URL=mongodb://noobaa:noobaa@coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX)" --env "BLOB_HOST=blob-mock-$(GIT_COMMIT)-$(NAME_POSTFIX)" --env "NOOBAA_LOG_LEVEL=all" $(TESTER_TAG) ./src/test/framework/run_npm_test_on_test_container.sh -s $(testname)
283+
$(CONTAINER_ENGINE) run $(CPUSET) --network noobaa-net --name noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX) --env "SUPPRESS_LOGS=$(SUPPRESS_LOGS)" --env "DB_TYPE=mongodb" --env "MONGODB_URL=mongodb://noobaa:noobaa@coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX)" --env "BLOB_HOST=blob-mock-$(GIT_COMMIT)-$(NAME_POSTFIX)" --env "NOOBAA_LOG_LEVEL=all" $(TESTER_TAG) ./src/test/framework/run_npm_test_on_test_container.sh -s $(testpath)
284284
@$(call stop_noobaa)
285285
@$(call stop_blob_mock)
286286
@$(call stop_mongo)
@@ -301,7 +301,7 @@ run-single-test-postgres: tester
301301
@$(call run_postgres)
302302
@$(call run_blob_mock)
303303
@echo "\033[1;34mRunning tests\033[0m"
304-
$(CONTAINER_ENGINE) run $(CPUSET) --network noobaa-net --name noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX) --env "SUPPRESS_LOGS=$(SUPPRESS_LOGS)" --env "POSTGRES_HOST=coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX)" --env "POSTGRES_USER=noobaa" --env "DB_TYPE=postgres" --env "PG_ENABLE_QUERY_LOG=true" --env "PG_EXPLAIN_QUERIES=true" --env "BLOB_HOST=blob-mock-$(GIT_COMMIT)-$(NAME_POSTFIX)" $(TESTER_TAG) ./src/test/framework/run_npm_test_on_test_container.sh -s $(testname)
304+
$(CONTAINER_ENGINE) run $(CPUSET) --network noobaa-net --name noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX) --env "SUPPRESS_LOGS=$(SUPPRESS_LOGS)" --env "POSTGRES_HOST=coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX)" --env "POSTGRES_USER=noobaa" --env "DB_TYPE=postgres" --env "PG_ENABLE_QUERY_LOG=true" --env "PG_EXPLAIN_QUERIES=true" --env "BLOB_HOST=blob-mock-$(GIT_COMMIT)-$(NAME_POSTFIX)" $(TESTER_TAG) ./src/test/framework/run_npm_test_on_test_container.sh -s $(testpath)
305305
@$(call stop_noobaa)
306306
@$(call stop_postgres)
307307
@$(call stop_blob_mock)

docs/dev_guide/run_coretest_locally.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Run simply with `sudo NC_CORETEST=true node ./node_modules/mocha/bin/mocha .src/
1010
More info can be found in [CI & Tests](#ci--tests).
1111

1212
### B) Containerized deployment (With DB)
13-
One way is to run it with: `make run-single-test testname=test_s3_bucket_policy.js`
13+
One way is to run it with: `make run-single-test testpath=integration_tests/api/s3/test_s3_bucket_policy.js`
1414
but it would take time to build the needed images, therefore we will focus on another way.
1515

1616
Another way is to create a postgres container and then run the test with the following steps:

src/test/framework/run_npm_test_on_test_container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function usage() {
2222
echo -e "Usage:\n\t${0} [options]"
2323
echo -e "\t-c|--command - Replace the unit test command (default: ${command})"
2424
echo -e "\t-s|--single - Get the desired unit test to run and running it,"
25-
echo -e "\t needs to get the file name for example test_object_io.js"
25+
echo -e "\t needs to get the relative path from the tests directory for example integration_tests/internal/test_object_io.js"
2626
exit 0
2727
}
2828

0 commit comments

Comments
 (0)