Skip to content

Commit

Permalink
refactor: centralise testing CI operations into top-level Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Jason C. Nucciarone <[email protected]>
  • Loading branch information
NucciTheBoss committed Jul 2, 2024
1 parent 60f0c13 commit 07f94fb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install dependencies
run: python3 -m pip install tox
- name: Run linters
run: tox run -e lint
run: make lint

unit-test:
name: Unit tests
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Install dependencies
run: python3 -m pip install tox
- name: Run tests
run: tox run -e unit
run: make unit

integration-test:
name: Integration tests
Expand Down
38 changes: 32 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,46 @@ FORMAT_YELLOW = \033[0;33m
FORMAT_BLUE = \033[0;34m
FORMAT_END = \033[0m

MUNGECTL := $(CURDIR)/src/mungectl
define INTEGRATION_TESTS
integration-configless
endef

define mungectl
@make -f $(MUNGECTL)/Makefile -C $(MUNGECTL) $(1)
endef

define slurmhelpers
@tox run -e $(1)
endef

##@ Build

.PHONY: snap
snap: ## Build Slurm snap package
@snapcraft -v pack
snap: ## Build snap package
snapcraft -v pack

##@ Lint

.PHONY: fmt
fmt: ## Format snap code
@$(call mungectl, "fmt")
@$(call slurmhelpers, "fmt")

.PHONY:
lint: ## Lint snap code
@$(call mungectl, "lint")
@$(call slurmhelpers, "lint")

##@ Test

define INTEGRATION_TESTS
integration-configless
endef
.PHONY: unit
unit: ## Run snap unit tests
@$(call mungectl, "unit")
@$(call slurmhelpers, "unit")

.PHONY: integration
integration: $(INTEGRATION_TESTS) ## Run Slurm integration tests with gambol
integration: $(INTEGRATION_TESTS) ## Run snap integration tests with gambol

.PHONY: check-snap-exists
check-snap-exists:
Expand Down

0 comments on commit 07f94fb

Please sign in to comment.