Skip to content

Commit 5757bde

Browse files
authored
Update testing instructions in README.md, Change testing execution in appveyor.yml (#366)
1 parent 686ae27 commit 5757bde

File tree

2 files changed

+183
-24
lines changed

2 files changed

+183
-24
lines changed

README.md

+65-13
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@
55
Build Info is Artifactory's open integration layer for the CI servers and build tools.
66
The build information is sent to Artifactory in json format.
77

8-
## Building and Testing the Sources
8+
## Building and testing the sources
99

10-
The code is built using Gradle and includes integration tests.<br/>
11-
It must run using JDK 8 and Gradle 5.6.2. If you are using different gradle version you can use the provided gradle wrapper.<br/>
12-
In order to run tests the following environment variable must be provide:
10+
* The code is built using Gradle and includes integration tests.<br/>
11+
* It must run using JDK 8 and Gradle 5.6.2. If you are using different gradle version you can use the provided gradle wrapper.<br/>
12+
* In order to run tests the following environment variables must be set:
1313
```
1414
export BITESTS_ARTIFACTORY_URL='http://localhost:8081/artifactory'
1515
export BITESTS_ARTIFACTORY_USERNAME=admin
1616
export BITESTS_ARTIFACTORY_PASSWORD=password
1717
export BITESTS_ARTIFACTORY_REPO=tests
1818
export BITESTS_ARTIFACTORY_PIP_ENV=/Users/user/venv-test/bin
1919
```
20-
Before running the tests, please make sure you have a generic repository named *tests* in Artifactory.
20+
* Before running the tests, please make sure you have a generic repository named *tests* in Artifactory.
21+
22+
### Building
23+
When running the following commands to build the code, the entire testing suite is also executed. See the *Testing* section for configuration instructions prior to running the tests.
2124

2225
To build the code using the gradle wrapper in Unix run:
2326
```
@@ -36,23 +39,72 @@ To build the code without running the tests, add to the "clean build" command th
3639
> ./gradlew clean build -x test
3740
```
3841

39-
### Running pip tests
40-
Pip tests must run inside a clean pip-environment. Create a virtual environment and provide the path to its '/bin' directory using the 'BITESTS_ARTIFACTORY_PIP_ENV' variable.
42+
### Testing
43+
To run *all* tests:
44+
```
45+
> ./gradlew clean test
46+
```
47+
48+
#### Extractor tests
49+
```
50+
> ./gradlew clean build-info-api:test build-info-client:test build-info-extractor:test build-info-vcs:test
51+
```
52+
53+
#### Maven tests
54+
```
55+
> ./gradlew clean build-info-extractor-maven3:test
56+
```
57+
58+
#### Gradle tests
59+
```
60+
> ./gradlew clean build-info-extractor-gradle:test
61+
```
62+
63+
#### Npm tests
64+
* Add npm executable to the system search path (PATH environment variable).
65+
```
66+
> ./gradlew clean build-info-extractor-npm:test
67+
```
68+
69+
#### Go tests
70+
* Add Go executable to the system search path (PATH environment variable).
71+
```
72+
> ./gradlew clean build-info-extractor-go:test
73+
```
74+
75+
#### Pip tests
76+
* Add Python and pip executables to the system search path (PATH environment variable).
77+
* Pip tests must run inside a clean pip-environment. Create a virtual environment and provide its path using the 'BITESTS_ARTIFACTORY_PIP_ENV' variable.
78+
When running on a Windows machine, provide the path to the 'Scripts' directory.
79+
When running on a unix machine, provide the path to the 'bin' directory.
80+
```
81+
> python -m venv buildinfo-tests-env
82+
> export BITESTS_ARTIFACTORY_PIP_ENV=/Users/user/buildinfo-tests-env/bin
83+
> ./gradlew clean build-info-extractor-pip:test
84+
```
85+
86+
#### NuGet tests
87+
* Add Nuget executable to the system search path (PATH environment variable).
88+
```
89+
> ./gradlew clean build-info-extractor-nuget:test
90+
```
91+
92+
### Testing on Artifactory OSS
93+
When testing with an instance of Artifactory OSS, only supported tests are for the build-info-gradle-extractor.
4194

42-
### Running Gradle tests on Artifactory OSS
4395
On Artifactory pro, the tests infrastructure will create the test repositories by REST API.
4496
To run the tests on Artifactory OSS, you should create the Gradle repositories by yourself.
4597
To run Gradle tests on Artifactory OSS:
46-
1. Start Artifactory on docker container:
98+
* Start Artifactory on docker container:
4799
```
48-
> docker run --name artifactory -d -p 8081:8081 docker.bintray.io/jfrog/artifactory-oss:latest
100+
> docker run --name artifactory -d -p 8081:8081 -p 8082:8082 docker.bintray.io/jfrog/artifactory-oss:latest
49101
```
50-
2. With your web browser, go to Artifactory UI: http://127.0.0.1:8081/artifactory
51-
3. Create 3 Gradle repositories:
102+
* With your web browser, go to Artifactory UI: http://127.0.0.1:8081/artifactory
103+
* Create 3 Gradle repositories:
52104
* Local repository: `build-info-tests-gradle-local`
53105
* Remote repository to jcenter: `build-info-tests-gradle-remote`
54106
* Virtual repository containing both the remote and local: `build-info-tests-gradle-virtual`
55-
4. Run tests `./gradlew build-info-extractor-gradle:test`
107+
* Run tests `./gradlew build-info-extractor-gradle:test`
56108

57109
## Build Info json format
58110

appveyor.yml

+118-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
stack: jdk 8, node 8, go 1.13
1+
stack: jdk 8, node 8, go 1.13, python 3.7.7
22
skip_tags: true
33
environment:
4-
matrix:
5-
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
6-
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
7-
GOPATH: c:\gopath
8-
# .NET CLI version
9-
CLI_VERSION: Latest
10-
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
114

125
BITESTS_ARTIFACTORY_URL:
136
secure: RIh0gGFDn2JAnLUEEqLsQm0ihToJ6/4LiR411QpvqDgYYE7Y4Eif2e+wYndvHXnW
@@ -18,8 +11,122 @@ environment:
1811
BITESTS_ARTIFACTORY_REPO:
1912
secure: Xf371RQAxCTMn/S7NdmV8g==
2013

21-
test_script:
22-
- sh: ./gradlew clean test
23-
- cmd: gradlew.bat clean test
14+
matrix:
15+
# Extractor Tests
16+
- job_name: extractor_win
17+
job_group: general
18+
appveyor_build_worker_image: Visual Studio 2019
19+
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
20+
TEST_SUIT:
21+
"gradlew.bat clean build-info-api:test build-info-client:test build-info-extractor:test build-info-vcs:test"
22+
- job_name: extractor_linux
23+
job_group: general
24+
appveyor_build_worker_image: Ubuntu
25+
TEST_SUIT:
26+
"./gradlew clean build-info-api:test build-info-client:test build-info-extractor:test build-info-vcs:test"
27+
28+
# Maven Tests
29+
- job_name: maven_extractor_win
30+
job_group: general
31+
appveyor_build_worker_image: Visual Studio 2019
32+
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
33+
TEST_SUIT:
34+
"gradlew.bat clean build-info-extractor-maven3:test"
35+
- job_name: maven_extractor_linux
36+
job_group: general
37+
appveyor_build_worker_image: Ubuntu
38+
TEST_SUIT:
39+
"./gradlew clean build-info-extractor-maven3:test"
40+
41+
# Gradle Tests
42+
- job_name: gradle_extractor_win
43+
job_group: general
44+
appveyor_build_worker_image: Visual Studio 2019
45+
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
46+
TEST_SUIT:
47+
"gradlew.bat clean build-info-extractor-gradle:test"
48+
- job_name: gradle_extractor_linux
49+
job_group: general
50+
appveyor_build_worker_image: Ubuntu
51+
TEST_SUIT:
52+
"./gradlew clean build-info-extractor-gradle:test"
53+
54+
# npm Tests
55+
- job_name: npm_extractor_win
56+
job_group: general
57+
appveyor_build_worker_image: Visual Studio 2019
58+
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
59+
TEST_SUIT:
60+
"gradlew.bat clean build-info-extractor-npm:test"
61+
- job_name: npm_extractor_linux
62+
job_group: general
63+
appveyor_build_worker_image: Ubuntu
64+
TEST_SUIT:
65+
"./gradlew clean build-info-extractor-npm:test"
66+
67+
# Go Tests
68+
- job_name: go_extractor_win
69+
job_group: general
70+
appveyor_build_worker_image: Visual Studio 2019
71+
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
72+
TEST_SUIT:
73+
"gradlew.bat clean build-info-extractor-go:test"
74+
- job_name: go_extractor_linux
75+
job_group: general
76+
appveyor_build_worker_image: Ubuntu
77+
TEST_SUIT:
78+
"./gradlew clean build-info-extractor-go:test"
79+
80+
# Pip Tests
81+
- job_name: pip_extractor_win
82+
job_group: pip
83+
appveyor_build_worker_image: Visual Studio 2019
84+
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
85+
BITESTS_ARTIFACTORY_PIP_ENV: C:\\projects\\build-info\\pip-venv\\Scripts
86+
TEST_SUIT:
87+
"gradlew.bat clean build-info-extractor-pip:test"
88+
- job_name: pip_extractor_linux
89+
job_group: pip
90+
appveyor_build_worker_image: Ubuntu
91+
PYTHON: $HOME/venv3.7.7
92+
BITESTS_ARTIFACTORY_PIP_ENV: /home/appveyor/projects/build-info/pip-venv/bin
93+
TEST_SUIT:
94+
"./gradlew clean build-info-extractor-pip:test"
95+
96+
# NuGet Tests
97+
- job_name: nuget_extractor_win
98+
job_group: general
99+
appveyor_build_worker_image: Visual Studio 2019
100+
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
101+
# .NET CLI version
102+
CLI_VERSION: Latest
103+
TEST_SUIT:
104+
"gradlew.bat clean build-info-extractor-nuget:test"
105+
- job_name: nuget_extractor_linux
106+
job_group: general
107+
appveyor_build_worker_image: Ubuntu
108+
# .NET CLI version
109+
CLI_VERSION: Latest
110+
TEST_SUIT:
111+
"./gradlew clean build-info-extractor-nuget:test"
112+
113+
for:
114+
-
115+
matrix:
116+
only:
117+
- job_group: general
118+
test_script:
119+
- sh: "$TEST_SUIT"
120+
- cmd: "%TEST_SUIT%"
121+
-
122+
matrix:
123+
only:
124+
- job_group: pip
125+
test_script:
126+
- sh: "python --version"
127+
- sh: "python -m venv pip-venv"
128+
- sh: "$TEST_SUIT"
129+
- cmd: "C:\\Python37-x64\\python -m venv pip-venv"
130+
- cmd: "%TEST_SUIT%"
24131

25132
build: off

0 commit comments

Comments
 (0)