Skip to content

Commit de49ed3

Browse files
committed
break up install-test-dependencies functionality
1 parent 777ac0c commit de49ed3

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

Makefile

+18-15
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ install-dependencies:
99
npm ci --prefer-offline --include=dev
1010
npx playwright install
1111

12+
# Install additional test dependencies to run VSCode testing in headless mode (on Linux)
13+
# ref: https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions
14+
.PHONY: install-test-dependencies
15+
install-test-dependencies:
16+
@echo "Installing test dependencies for $(shell uname -s)"
17+
@if [ $$(uname -s) = "Linux" ]; then \
18+
sudo apt-get update; \
19+
sudo apt install -y libgbm1 libgtk-3-0 xvfb; \
20+
elif [ $$(uname -s) = "Darwin" ]; then \
21+
sudo brew update; \
22+
sudo brew install gtk+3; \
23+
sudo brew install --cask xquartz; \
24+
else \
25+
echo "Unsupported OS for headless testing"; \
26+
exit 1; \
27+
fi
28+
1229
.PHONY: setup-test-env
1330
setup-test-env:
1431
@echo "Pulling automated-test-user credentials from Vault into .env file for testing"
@@ -20,22 +37,8 @@ remove-test-env:
2037
@echo "Removing .env file"
2138
@rm -f .env
2239

23-
# Install additional test dependencies to run VSCode testing in headless mode (on Linux)
24-
# ref: https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions
2540
.PHONY: test
26-
test: setup-test-env install-dependencies
27-
@echo "Installing test dependencies for $(shell uname -s)"
28-
@if [ $$(uname -s) = "Linux" ]; then \
29-
sudo apt-get update; \
30-
sudo apt install -y libgbm1 libgtk-3-0 xvfb; \
31-
elif [ $$(uname -s) = "Darwin" ]; then \
32-
brew update; \
33-
brew install gtk+3; \
34-
brew install --cask xquartz; \
35-
else \
36-
echo "Unsupported OS for headless testing"; \
37-
exit 1; \
38-
fi
41+
test: setup-test-env install-test-dependencies install-dependencies
3942
npx gulp ci
4043
@if [ $$(uname -s) = "Linux" ]; then \
4144
xvfb-run -a npx gulp test; \

0 commit comments

Comments
 (0)