Skip to content

Commit 71f2045

Browse files
committed
Update README.md.
1: update section on .env file to reference .env-example and match contents of .env-example 2: Included information from ./build/ci/README.md in top level README.md and delete the file. 3: reword sections to avoid use of "you" and "your" 4: add information on yast test
1 parent 62ac5f9 commit 71f2045

File tree

2 files changed

+58
-65
lines changed

2 files changed

+58
-65
lines changed

README.md

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
[![build result](https://build.opensuse.org/projects/systemsmanagement:SCC/packages/suseconnect-ng/badge.svg?type=default)](https://build.opensuse.org/package/show/systemsmanagement:SCC/suseconnect-ng)
44

55
SUSEConnect is a Golang command line tool for connecting a client system to the SUSE Customer Center.
6-
It will connect the system to your product subscriptions and enable the product repositories/services locally.
6+
It will connect the system to product subscriptions and enable the product repositories/services locally.
77

88
SUSEConnect-ng reduces the size of its runtime dependencies compared to the
99
replaced [Ruby SUSEConnect](https://github.com/SUSE/connect).
1010

1111
SUSEConnect-ng is distributed as RPM for all SUSE distributions and gets built in
1212
the [openSUSE build service](https://build.opensuse.org/package/show/systemsmanagement:SCC/suseconnect-ng).
1313

14-
Please visit https://scc.suse.com to see and manage your subscriptions.
14+
Please visit https://scc.suse.com to view and manage subscriptions.
1515

1616
SUSEConnect-ng communicates with SCC over this [REST API](https://github.com/SUSE/connect/blob/master/doc/SCC-API-%28Implemented%29.md).
1717

@@ -24,30 +24,75 @@ make build
2424
This will create a `out/suseconnect` binary.
2525

2626
### Build in container
27-
If you don't have a go compiler installed, you can run the build in a container:
27+
If the local system does not have a go compiler installed, the build can be done in a container:
2828
```
2929
docker run --rm -v $(pwd):/connect registry.suse.com/bci/golang:1.21-openssl sh -c "git config --global --add safe.directory /connect; cd /connect; make build"
3030
```
3131
This will create a `out/suseconnect` binary on the host.
3232

3333
### Testing
34+
Pull requests must pass CI testing to be approved. These tests can be run locally before the PR is created. There are three sets of CI tests:
35+
* Format, unit, and build tests
36+
* Feature tests
37+
* Yast tests
3438

35-
You can run all unit tests by running `make test`. If you then want to run unit
36-
tests for a specific package, you can simply run it as you would do for any Go
39+
#### Unit Tests
40+
Users can run all unit tests by running `make test`. Unit
41+
tests for a specific package can be run it as for any Go
3742
project, for example: `go test ./internal/collectors/`.
3843

39-
For feature tests you first need to create an `.env` file in the root directory
40-
of the project with the following contents:
44+
#### Format Test
45+
Users can run the go format test by running `make check-format`
46+
47+
#### Feature Tests
48+
49+
Feature tests require an `.env` file in the root directory
50+
of the project. There is an .env-example; copy .env-example to .env and update the following entries.
4151

4252
``` sh
43-
BETA_VALID_REGCODE="<regcode>"
44-
BETA_NOT_ACTIVATED_REGCODE="<regcode>"
45-
VALID_REGCODE="<regcode>"
46-
EXPIRED_REGCODE="<regcode>"
47-
NOT_ACTIVATED_REGCODE="<regcode>"
53+
REGCODE=
54+
HA_REGCODE=
55+
EXPIRED_REGCODE=
56+
4857
```
4958

5059
These values can be picked up from Glue's production environment. Once that is
51-
done, you can then simply run `make feature-tests`. This will run a all feature
60+
done, run `make feature-tests`. This will run all feature
5261
tests inside of a container by using the registration codes as provided by the
5362
`.env` file.
63+
64+
**Running Featre tests in a container**
65+
66+
The Feture tests can be run using the official SUSE Golang container:
67+
68+
```
69+
export IMAGE="registry.suse.com/bci/golang:1.21-openssl"
70+
# Run the required container:
71+
$ docker run --rm -it --env-file .env -w /usr/src/connect-ng -v $(pwd):/usr/src/connect-ng $IMAGE
72+
73+
# To build the connect-ng rpms within the container use:
74+
$ docker run --rm -it -w /usr/src/connect-ng -v $(pwd):/usr/src/connect-ng $IMAGE 'build/ci/build-rpm'
75+
76+
# Run feature tests in the container
77+
$ docker run --rm -it --env-file .env -w /usr/src/connect-ng -v $(pwd):/usr/src/connect-ng $IMAGE bash -c 'build/ci/build-rpm && build/ci/configure && build/ci/run-feature-tests'
78+
```
79+
80+
### YaST integration tests / yast (pull_request)
81+
The YaST integration tests are run via the Makefile
82+
```
83+
make test-yast
84+
```
85+
86+
#### Workflow Definitions
87+
88+
##### Lint and unit tests
89+
workflow definition: [.github/workflows/lint-unit.yml](https://github.com/SUSE/connect-ng/blob/main/.github/workflows/lint-unit.yml)
90+
91+
##### Feature Tests
92+
workflow definition: [.github/workflows/features.yml](https://github.com/SUSE/connect-ng/blob/main/.github/workflows/features.yml)
93+
94+
##### Yast Test
95+
workflow definition: [.github/workflows/yast.yml](https://github.com/SUSE/connect-ng/blob/main/.github/workflows/yast.yml)
96+
97+
98+

build/ci/README.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)