Skip to content

Commit ecaf87d

Browse files
committed
remove populate and create only methods and commands and update README
1 parent 211f3c0 commit ecaf87d

4 files changed

Lines changed: 28 additions & 80 deletions

File tree

README.md

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# practitest-firecracker
22

3-
You will need to use the 'create-testset' action once and the 'populate-testset' action every time there is a new report.
4-
If the structure of the report changes (new tests are added for example), you will need to use the 'create-testset' action again. New TestSets will be created, but existing tests will be reused.
3+
You will need to use the 'create-and-populate-testset' action that will create and populate TestSets, Tests, Instances and Runs.
4+
If the structure of the report changes (new tests are added for example), you will need to use the 'create-and-populate-testset' action again. New TestSets will be created, but existing tests will be reused.
55

66
If you don't have an existing CONFIG_FILE and you want to use it, go to https://firecracker-ui-prod.practitest.com/ and generate one.
77
To login, you can use your PractiTest credentials and follow the instructions in the link. Then you can continue here and set the config-path to your configuration file path.
@@ -23,35 +23,12 @@ java -jar practitest-firecracker-standalone.jar help
2323
```
2424
to get more information about the parameters and commands.
2525

26-
### create-testset
26+
### version
2727

28-
Create new testset from reports folder:
28+
To check your jar version you can you this command:
2929

3030
``` shell
31-
java -jar practitest-firecracker-standalone.jar \
32-
--reports-path=SUREFIRE_REPORTS_PATH \
33-
--testset-name="TestSet name" \
34-
--author-id=PRACTITEST_USER_ID \
35-
--config-path=CONFIG_FILE \
36-
create-testset
37-
```
38-
39-
The call above will analyze the surefire reports and create tests and the testset. If a test already exists, it will be reused.
40-
41-
You can set various custom fields for tests when they are created (especially useful if you have mandatory fields configured in your tests).
42-
43-
To set custom fields you will need to create a configuration file in here: https://firecracker-ui-prod.practitest.com/ .After that you can use it to run the command line above with it (CONFIG_FILE).
44-
45-
### populate-testset
46-
Populate the testset from reports folder:
47-
48-
``` shell
49-
java -jar practitest-firecracker-standalone.jar \
50-
--reports-path=SUREFIRE_REPORTS_PATH \
51-
--testset-id=PRACTITEST_TESTSET_ID \
52-
--author-id=PRACTITEST_USER_ID \
53-
--config-path=CONFIG_FILE \
54-
populate-testset
31+
java -jar practitest-firecracker-standalone.jar version
5532
```
5633

5734
### create-and-populate-testset
@@ -62,32 +39,39 @@ Example:
6239

6340
``` shell
6441
java -jar practitest-firecracker-standalone.jar \
65-
--reports-path=SUREFIRE_REPORTS_PATH \
66-
--testset-name="TestSet name" \
42+
--reports-path=REPORTS_FOLDER_PATH \
6743
--author-id=PRACTITEST_USER_ID \
6844
--config-path=CONFIG_FILE \
6945
create-and-populate-testset
7046
```
71-
* In the future config files --testset-name will be defined inside of the config file so there will be no need to define it in the command line
47+
* author-id is not required in case of PAT (personal api token) is in use
48+
49+
The call above will analyze the surefire reports and create and populate tests and the testset. If a test already exists, it will be reused.
50+
51+
You can set various custom fields for tests when they are created (especially useful if you have mandatory fields configured in your tests).
52+
53+
To set custom fields you will need to create a configuration file in here: https://firecracker-ui-prod.practitest.com/ .After that you can use it to run the command line above with it (CONFIG_FILE).
54+
7255
### use Firecracker without config file
7356

7457
You can use all the above commands without the config file. You will need to explicitly define
7558
parameters:
7659
--api-token=YOUR_API_TOKEN
7760
--email=YOUR_EMAIL
61+
--testset-name=TESTSET_NAME
7862
--project-id=PRACTITEST_PROJECT_ID
79-
--additional-test-fields '{"custom-fields": {"---f-123": "foo", "---f-124": "bar"}, "system-fields"{"version": "2.3", "status":"Draft"}}'
80-
--additional-testset-fields '{"custom-fields": {"---f-125": "baz"}, "system-fields"{"version": "1.0", "assigned-to-id": "1"}}
63+
--additional-test-fields='{"custom-fields": {"---f-123": "foo", "---f-124": "bar"}, "system-fields"{"version": "2.3", "status":"Draft"}}'
64+
--additional-testset-fields='{"custom-fields": {"---f-125": "baz"}, "system-fields"{"version": "1.0", "assigned-to-id": "1"}}
8165
if they are relevant to the run (additional-fields not required).
8266

8367

8468
Example:
85-
8669
``` shell
8770
java -jar practitest-firecracker-standalone.jar \
8871
--api-token=YOUR_API_TOKEN \
8972
--email=YOUR_EMAIL \
90-
--reports-path=SUREFIRE_REPORTS_PATH \
73+
--testset-name=TESTSET_NAME \
74+
--reports-path=REPORTS_FOLDER_PATH \
9175
--project-id=PRACTITEST_PROJECT_ID \
9276
--testset-name="TestSet name" \
9377
--author-id=PRACTITEST_USER_ID \
@@ -118,6 +102,11 @@ In case you want the name of the test to take its value from other attribute of
118102

119103
Same goes for --pt-test-step-name that will define the name of the steps.
120104

105+
--multitestset option will point if we are using multitestset file if it is true we will take the testsetname from
106+
the name attribute from inside the file.
107+
108+
--test-case-as-pt-test-step will declare if we want to set testcase as single test or as a group of testcases.
109+
121110
For more information contact our support.
122111

123112
## License

src/practitest_firecracker/cli.clj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,8 @@
7474
options-summary
7575
""
7676
"Actions:"
77-
" create-testset Analyzes the given Surefire reports directory and creates a TestSet with Tests and Steps in PractiTest to reflect"
78-
" the structure of the report. Returns a TestSet ID that you should use to run the 'populate-testset' action"
79-
" populate-testset Analyzes the given Surefire reports directory and populates the given TestSet with the data from the report"
80-
" create-and-populate-testset Shortcut to perform both actions. If the TestSet with the given name already exists, it will be reused. If it exists, but has completely different set of tests, an error will be reported."
81-
""]
77+
" create-and-populate-testset Shortcut to perform both actions. If the TestSet with the given name already exists, it will be reused. If it exists, but has completely different set of tests, an error will be reported."
78+
" version Will display firecracker jar file version"]
8279
(string/join \newline)))
8380

8481
(defn error-msg [errors]
@@ -116,7 +113,7 @@
116113
(= "display-options" (first arguments))
117114
{:action "display-options" :options options}
118115

119-
(= "version")
116+
(= "version" (first arguments))
120117
{:action "version" :options options}
121118
;; (= "create-testset" (first arguments))
122119
;; (cond

src/practitest_firecracker/core.clj

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[practitest-firecracker.cli :refer [parse-args]]
44
[practitest-firecracker.practitest :refer [make-client
55
make-runs
6-
populate-sf-results
76
create-testsets
87
group-tests
98
create-or-update-tests
@@ -47,29 +46,7 @@
4746
(pprint/pprint {"=============== args: ===============" args}))
4847

4948
"version"
50-
(do
51-
(println "Version: " fc-version))
52-
53-
;; "create-testset"
54-
;; (do
55-
;; (doall
56-
;; (pmap
57-
;; (fn [report]
58-
;; (let [testset (create-or-update-sf-testset client options report)]
59-
;; (pprint/pprint (format "Populated TestSet ID: %s" (:id testset)))))
60-
;; additional-reports))
61-
;; (exit 0 "Done"))
62-
63-
"populate-testset"
64-
(do
65-
(doall
66-
(pmap
67-
(fn [report]
68-
(populate-sf-results client
69-
options
70-
report))
71-
additional-reports))
72-
(exit 0 "Done"))
49+
(println "Version: " fc-version)
7350

7451
"create-and-populate-testset"
7552
(do

src/practitest_firecracker/practitest.clj

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -489,21 +489,6 @@
489489
:attributes run
490490
:steps run-steps}))))))
491491

492-
(defn populate-sf-results [client {:keys [project-id testset-id display-action-logs] :as options} sf-test-suites]
493-
(when display-action-logs (log/infof "populating testset %s with results from %d suites" testset-id (count sf-test-suites)))
494-
(when (or (:skip-validation? options)
495-
(validate-testset client project-id testset-id sf-test-suites))
496-
(doall
497-
(pmap (fn [test-suite]
498-
(let [test-name (sf-test-suite->pt-test-name options test-suite)
499-
log (if display-action-logs (log/infof "instance test-name: %s " test-name) nil)
500-
test (ll-find-test client [project-id display-action-logs] test-name)
501-
instance (ll-find-instance client [project-id display-action-logs] testset-id (:id test))
502-
[run run-steps] (sf-test-suite->run-def options test-suite)]
503-
(ll-create-run client [project-id display-action-logs] (:id instance) run run-steps)))
504-
sf-test-suites))
505-
true))
506-
507492
(defn find-sf-testset [client [project-id display-action-logs] options testset-name]
508493
(let [testset (ll-find-testset client [project-id display-action-logs] testset-name)]
509494
(when testset

0 commit comments

Comments
 (0)