Skip to content

Commit

Permalink
Update MicroCloud look and feel (#505)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
roosterfish authored Dec 13, 2024
2 parents bb27c5b + f327082 commit 563c565
Show file tree
Hide file tree
Showing 36 changed files with 1,859 additions and 1,407 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
- name: Build
run: |
make deps
make
make build-test
- name: Run static analysis
run: make check-static
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ else
go install -tags=agent -v -cover ./cmd/microcloudd
endif

# Build MicroCloud for testing. Replaces EFF word-list,
# and enables feeding input to questions from a file with TEST_CONSOLE=1.
.PHONY: build-test
build-test:
ifeq "$(GOCOVERDIR)" ""
go install -tags=test -v ./cmd/microcloud
go install -tags=test -v ./cmd/microcloudd
else
go install -tags=test -v -cover ./cmd/microcloud
go install -tags=test -v -cover ./cmd/microcloudd
endif

# Testing targets.
.PHONY: check
check: check-static check-unit check-system
Expand Down
2 changes: 1 addition & 1 deletion cmd/microcloud/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c *cmdAdd) Run(cmd *cobra.Command, args []string) error {
bootstrap: false,
setupMany: true,
common: c.common,
asker: &c.common.asker,
asker: c.common.asker,
systems: map[string]InitSystem{},
state: map[string]service.SystemInformation{},
}
Expand Down
Loading

0 comments on commit 563c565

Please sign in to comment.