Skip to content

Commit 563c565

Browse files
authored
Update MicroCloud look and feel (#505)
Uses https://github.com/charmbracelet/lipgloss to implement tables and questions in MicroCloud. * There is much more colour in the CLI now. This can be disabled with the `NO_COLOR` environment variable or the `--no-color` flag. * `make build-test` has been added to the Makefile, which builds MicroCloud with different input/output sources to work with the system tests. `TEST_CONSOLE=1` only works with this build tag now. * the test tag also replaces the EFF wordlist with a predictable 'a a a a' to reduce complexity in the test script and make debugging easier. * package dependencies for the old implementation and test console have been removed. * there is a new file at `/var/snap/microcloud/common/test-output` that is generated with the test build tag and `TEST_CONSOLE=1` to show how each question interpreted the pre-defined input.
2 parents bb27c5b + f327082 commit 563c565

36 files changed

+1859
-1407
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
- name: Build
9999
run: |
100100
make deps
101-
make
101+
make build-test
102102
103103
- name: Run static analysis
104104
run: make check-static

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ else
3535
go install -tags=agent -v -cover ./cmd/microcloudd
3636
endif
3737

38+
# Build MicroCloud for testing. Replaces EFF word-list,
39+
# and enables feeding input to questions from a file with TEST_CONSOLE=1.
40+
.PHONY: build-test
41+
build-test:
42+
ifeq "$(GOCOVERDIR)" ""
43+
go install -tags=test -v ./cmd/microcloud
44+
go install -tags=test -v ./cmd/microcloudd
45+
else
46+
go install -tags=test -v -cover ./cmd/microcloud
47+
go install -tags=test -v -cover ./cmd/microcloudd
48+
endif
49+
3850
# Testing targets.
3951
.PHONY: check
4052
check: check-static check-unit check-system

cmd/microcloud/add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (c *cmdAdd) Run(cmd *cobra.Command, args []string) error {
4848
bootstrap: false,
4949
setupMany: true,
5050
common: c.common,
51-
asker: &c.common.asker,
51+
asker: c.common.asker,
5252
systems: map[string]InitSystem{},
5353
state: map[string]service.SystemInformation{},
5454
}

0 commit comments

Comments
 (0)