Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
y3rsh committed Nov 20, 2024
1 parent d332872 commit 47c6819
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
21 changes: 15 additions & 6 deletions analyses-snapshot-testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,27 @@ LOCAL_IMAGE_NAME ?= opentrons-analysis:local
.PHONY: build-local
build-local:
@echo "Building docker image for your local opentrons code"
@echo "The image will be named opentrons-analysis:local"
@echo "For a fresh build, run 'make local-build NO_CACHE=1'"
docker build --build-arg BASE_IMAGE_NAME=$(BASE_IMAGE_NAME) $(BUILD_FLAGS) -t $(LOCAL_IMAGE_NAME) -f citools/Dockerfile.local .. || true
@echo "The image name is set with variable LOCAL_IMAGE_NAME and is $(LOCAL_IMAGE_NAME)"
docker build --build-arg BASE_IMAGE_NAME=$(BASE_IMAGE_NAME) -t $(LOCAL_IMAGE_NAME) -f citools/Dockerfile.local .. || true
@echo "Build complete"

.PHONY: snapshot-test-local
snapshot-test-local: ANALYSIS_REF=$(LOCAL_IMAGE_NAME)
snapshot-test-local:
export ANALYSIS_REF=$(LOCAL_IMAGE_NAME)
@echo "ANALYSIS_REF is $(ANALYSIS_REF)"
@echo "This target is overriding the ANALYSIS_REF to the local image name: $(LOCAL_IMAGE_NAME)"
@echo "ANALYSIS_REF is $(ANALYSIS_REF). This is the image used in the test."
@echo "PROTOCOL_NAMES is $(PROTOCOL_NAMES)"
@echo "OVERRIDE_PROTOCOL_NAMES is $(OVERRIDE_PROTOCOL_NAMES)"
$(PYTHON) -m pipenv run pytest -k analyses_snapshot_test -vv

.PHONY: snapshot-test-update-local
snapshot-test-update-local: ANALYSIS_REF=$(LOCAL_IMAGE_NAME)
snapshot-test-update-local:
@echo "This target is overriding the ANALYSIS_REF to the local image name: $(LOCAL_IMAGE_NAME)"
@echo "ANALYSIS_REF is $(ANALYSIS_REF). This is the image used in the test."
@echo "PROTOCOL_NAMES is $(PROTOCOL_NAMES)"
@echo "OVERRIDE_PROTOCOL_NAMES is $(OVERRIDE_PROTOCOL_NAMES)"
$(PYTHON) -m pipenv run pytest -k analyses_snapshot_test -vv
$(PYTHON) -m pipenv run pytest -k analyses_snapshot_test --snapshot-update

.PHONY: generate-protocols
generate-protocols:
Expand Down
6 changes: 5 additions & 1 deletion analyses-snapshot-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ cd analyses-snapshot-testing \
`make build-local` - on top of the base, copy in the local code and build
`make snapshot-test-local` - run the analyses battery against the image you just created

> make sure to run `make build-local` after you make changes to the code to update the image
> make sure to run `make build-local` after you make changes to the code to update the image!!!

You have the option to specify one or many protocols to run the analyses on. This is also described above [Running the tests against specific protocols](#running-the-tests-against-specific-protocols)

- `make snapshot-test-local PROTOCOL_NAMES=Flex_S_v2_19_Illumina_DNA_PCR_Free OVERRIDE_PROTOCOL_NAMES=none`

### Updating the snapshots locally

- `make snapshot-test-update-local`

0 comments on commit 47c6819

Please sign in to comment.