Skip to content

Commit

Permalink
Add makefile for quickly reviewing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
unlikelyzero committed Sep 17, 2024
1 parent 674f920 commit eb65f10
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ test-results
# Misc
.DS_Store
.vscode/settings.json

quickstart/
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.PHONY: all clone-quickstart setup-quickstart setup-openmct-yamcs sanity-test build-example test-getopensource test-e2e clean

all: clone-quickstart setup-quickstart setup-openmct-yamcs sanity-test build-example test-getopensource test-e2e

clone-quickstart:
@echo "Running target: clone-quickstart"
@echo "Current working directory: $(shell pwd)"
if [ ! -d "quickstart" ]; then \
git clone https://github.com/yamcs/quickstart; \
else \
echo "Directory 'quickstart' already exists."; \
fi

setup-quickstart:
@echo "Running target: setup-quickstart"
cd quickstart/docker && make wait-for-sent

setup-openmct-yamcs:
@echo "Running target: setup-openmct-yamcs"
npm install

sanity-test:
@echo "Running target: sanity-test"
npm run wait-for-yamcs

build-example:
@echo "Running target: build-example"
@current_branch=$(shell git rev-parse --abbrev-ref HEAD)
@echo "Current branch of openmct-yamcs: $$current_branch checking if it exists in openmct repository"
@if git ls-remote --exit-code --heads https://github.com/nasa/openmct.git refs/heads/$$current_branch; then \
echo "Branch $$current_branch exists in openmct repository. Running build:example:current"; \
npm run build:example:current || { echo "Failed to run build:example:current"; exit 1; }; \
else \
echo "Branch $$current_branch does not exist in openmct repository. Running build:example:master"; \
npm run build:example:master || { echo "Failed to run build:example:master"; exit 1; }; \
fi

test-getopensource:
@echo "Running target: test-getopensource"
npm run test:getopensource

test-e2e:
@echo "Running target: test-e2e"
npm run test:e2e:quickstart:local

clean:
@echo "Running target: clean"
npm run clean
if [ -d "quickstart" ]; then \
rm -rf quickstart; \
echo "Removed 'quickstart' directory."; \
else \
echo "Directory 'quickstart' does not exist."; \
fi
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
"lint:fix": "eslint src example --fix",
"build:dist": "webpack --config ./.webpack/webpack.prod.mjs",
"build:example": "npm install openmct@unstable --no-save",
"build:example:master": "npm install nasa/openmct --no-save",
"postbuild:example": "node check-optional-dependencies.mjs",
"start": "npx webpack serve --config ./.webpack/webpack.dev.mjs",
"start:coverage": "npx webpack serve --config ./.webpack/webpack.coverage.mjs",
"build:example:master": "npm install nasa/openmct#master --no-save",
"build:example:current": "npm install nasa/openmct#$(git rev-parse --abbrev-ref HEAD) --no-save --verbose",
"postbuild:example": "node check-optional-dependencies.js",
"start": "npx webpack serve --config ./.webpack/webpack.dev.js",
"start:coverage": "npx webpack serve --config ./.webpack/webpack.coverage.js",
"prepare": "npm run build:dist",
"test:getopensource": "sh ./tests/git-opensource-tests.sh",
"posttest:getopensource": "npm install",
Expand Down

0 comments on commit eb65f10

Please sign in to comment.