Skip to content

Commit d92a00e

Browse files
authored
Merge pull request #4 from PractiTest/readme-update
README + fix for populate command
2 parents ed9c37e + 44ffe4f commit d92a00e

File tree

3 files changed

+49
-31
lines changed

3 files changed

+49
-31
lines changed

README.md

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,47 @@
33
You will need to use 'create-testset' action once and 'populate-testset' action every time there is a new report.
44
If the structure of the report changes (new tests added for example), you will need to use 'create-testset' action again. New TestSet will be created, but existing tests will be reused.
55

6+
If you don't have exsiting CONFIG_FILE and you want to use it go to https://firecracker-ui-prod.practitest.com/ and generate one.
7+
To login you can use your PractiTest credentials, follow the instructions in the link and then you can continue here, set config-path to your configuration file path.
68
## Usage
79

10+
### help
11+
12+
At every point you can run:
13+
14+
``` shell
15+
java -jar practitest-firecracker-standalone.jar help
16+
```
17+
to get more information about the parameters and commands.
18+
819
### create-testset
920

1021
Create new testset from reports folder:
1122

1223
``` shell
13-
java -jar practitest-firecracker-standaline.jar \
14-
--api-token=YOUR_API_TOKEN \
15-
--email=YOUR_EMAIL \
24+
java -jar practitest-firecracker-standalone.jar \
1625
--reports-path=SUREFIRE_REPORTS_PATH \
17-
--project-id=PRACTITEST_PROJECT_ID \
1826
--testset-name="TestSet name" \
1927
--author-id=PRACTITEST_USER_ID \
28+
--config-path=CONFIG_FILE \
2029
create-testset
2130
```
2231

2332
The call above will analyze the surefire reports and create tests and testset. If a test already exists, it will be reused.
24-
You can set various custom fields for tests when they are created (especially useful if you have mandatory fields configured in your tests).
25-
Here is an example for setting custom fields during creation of the tests and testset:
2633

27-
``` shell
28-
java -jar practitest-firecracker-standaline.jar \
29-
--api-token=YOUR_API_TOKEN \
30-
--email=YOUR_EMAIL \
31-
--reports-path=SUREFIRE_REPORTS_PATH \
32-
--project-id=PRACTITEST_PROJECT_ID \
33-
--testset-name="TestSet name" \
34-
--author-id=PRACTITEST_USER_ID \
35-
--additional-test-fields '{"custom-fields": {"---f-123": "foo", "---f-124": "bar"}}' \
36-
--additional-testset-fields '{"custom-fields": {"---f-125": "baz"}}' \
37-
create-testset
38-
39-
```
34+
You can set various custom fields for tests when they are created (especially useful if you have mandatory fields configured in your tests).
4035

41-
Replace the field ids with the actual IDs, you can see all your custom fields by calling this API call: [get-all-custom-fields-in-your-project](https://www.practitest.com/api-v2/#get-all-custom-fields-in-your-project)
36+
To set custom fields you will need to create 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).
4237

4338
### populate-testset
4439
Populate the testset from reports folder:
4540

4641
``` shell
47-
java -jar practitest-firecracker-standaline.jar \
48-
--api-token=YOUR_API_TOKEN \
49-
--email=YOUR_EMAIL \
42+
java -jar practitest-firecracker-standalone.jar \
5043
--reports-path=SUREFIRE_REPORTS_PATH \
51-
--project-id=PRACTITEST_PROJECT_ID \
5244
--testset-id=PRACTITEST_TESTSET_ID \
45+
--author-id=PRACTITEST_USER_ID \
46+
--config-path=CONFIG_FILE \
5347
populate-testset
5448
```
5549

@@ -60,7 +54,29 @@ This will attempt to do the two actions above at once. It will search for TestSe
6054
Example:
6155

6256
``` shell
63-
java -jar practitest-firecracker-standaline.jar \
57+
java -jar practitest-firecracker-standalone.jar \
58+
--reports-path=SUREFIRE_REPORTS_PATH \
59+
--testset-name="TestSet name" \
60+
--author-id=PRACTITEST_USER_ID \
61+
--config-path=CONFIG_FILE \
62+
create-and-populate-testset
63+
```
64+
### use Firecracker without config file
65+
66+
You can use all the above command without the config file you will need to explicitly define
67+
parameters:
68+
--api-token=YOUR_API_TOKEN
69+
--email=YOUR_EMAIL
70+
--project-id=PRACTITEST_PROJECT_ID
71+
--additional-test-fields '{"custom-fields": {"---f-123": "foo", "---f-124": "bar"}, "system-fields"{"version": "2.3", "status":"Draft"}}'
72+
--additional-testset-fields '{"custom-fields": {"---f-125": "baz"}, "system-fields"{"version": "1.0", "assigned-to-id": "1"}}
73+
if they are relevant to the run (additional-fields not required).
74+
75+
76+
Example:
77+
78+
``` shell
79+
java -jar practitest-firecracker-standalone.jar \
6480
--api-token=YOUR_API_TOKEN \
6581
--email=YOUR_EMAIL \
6682
--reports-path=SUREFIRE_REPORTS_PATH \
@@ -72,6 +88,9 @@ java -jar practitest-firecracker-standaline.jar \
7288
create-and-populate-testset
7389
```
7490

91+
You can set various custom fields for tests when they are created (especially useful if you have mandatory fields configured in your tests).
92+
93+
Replace the field ids with the actual IDs, you can see all your custom fields by calling this API call: [get-all-custom-fields-in-your-project](https://www.practitest.com/api-v2/#get-all-custom-fields-in-your-project)
7594

7695
## License
7796

src/practitest_firecracker/core.clj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@
5151

5252
"populate-testset"
5353
(do
54-
(populate-sf-results-old client
55-
(:project-id options)
56-
(:testset-id options)
57-
additional-reports)
54+
(populate-sf-results client
55+
options
56+
additional-reports)
5857
(exit 0 "Done"))
5958

6059
"create-and-populate-testset"

src/practitest_firecracker/practitest.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
;; ===========================================================================
1212
;; api version
13-
(def ^:const fc-version "1.4.0")
13+
(def ^:const fc-version "1.1.1")
1414

1515
;; ===========================================================================
1616
;; utils
@@ -381,7 +381,7 @@
381381
;; otherwise -- go on
382382
(let [instances (ll-testset-instances client project-id testset-id)
383383
tests (map (fn [test-suite]
384-
(let [name (str (:package-name test-suite) ":" (:name test-suite))]
384+
(let [name (:name test-suite)]
385385
[name (ll-find-test client project-id name)]))
386386
sf-test-suites)
387387
nil-tests (filter #(nil? (last %)) tests)]

0 commit comments

Comments
 (0)