Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify e2e tests #33

Merged
16 commits merged into from
Aug 25, 2023
Merged

Simplify e2e tests #33

16 commits merged into from
Aug 25, 2023

Conversation

becky-dt
Copy link

@becky-dt becky-dt commented Aug 21, 2023

Description

Removing e2e pytest tests and adding a wait in so that make run waits for the pipeline to finish before returning. Replaced make e2e-tests with make run wait=true in e2e-test.yaml CI pipeline

How has this been tested?

CI checks should be sufficient

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have successfully run the E2E tests
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated any relevant documentation to reflect my changes
  • I have assigned a reviewer and messaged them

@becky-dt
Copy link
Author

/gcbrun

2 similar comments
@becky-dt
Copy link
Author

/gcbrun

@becky-dt
Copy link
Author

/gcbrun

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of minor changes but overall looks great!

Makefile Outdated Show resolved Hide resolved
pipelines/src/pipelines/utils/trigger_pipeline.py Outdated Show resolved Hide resolved
@becky-dt
Copy link
Author

/gcbrun

@becky-dt becky-dt marked this pull request as ready for review August 22, 2023 12:45
@becky-dt becky-dt requested a review from a user August 22, 2023 12:45
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@becky-dt
Copy link
Author

/gcbrun

README.md Outdated Show resolved Hide resolved
@becky-dt becky-dt changed the title add wait param to MAKEFILE to wait until pipeline ends in make run Simplify e2e tests Aug 23, 2023
@becky-dt
Copy link
Author

/gcbrun

@ghost ghost force-pushed the refactor/simplify-e2e-tests branch from dd7829f to 9907264 Compare August 23, 2023 14:32
@ghost
Copy link

ghost commented Aug 23, 2023

/gcbrun

@ghost
Copy link

ghost commented Aug 23, 2023

/gcbrun

@ghost
Copy link

ghost commented Aug 23, 2023

/gcbrun

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the changes, just noticed that test task isn't documented in this Makefile.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have missed this during the rebase. @roberta-dt please could you take a look?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +48 to +49
make run pipeline=training build=false wait=true && \
make run pipeline=prediction build=false wait=true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@browningjp-datatonic why don't we build containers when running e2e tests?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The containers are built in the previous pipeline step. We pass build=false here because make build would create a separate Cloud Build job (which fails in this case, because it relies on the gcloud command that is not available in the CI container image)

Comment on lines 101 to 105
if args.wait.lower() == "true":
wait = True
elif args.wait.lower() != "false":
raise ValueError("wait variable must be 'true' or 'false'")
wait = False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@becky-dt can you please check for similar logic elsewhere in this repo? would like to follow the same logic or even import a reusable function for parsing boolean flags from the command-line. thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felix-datatonic There are a couple more booleans in the Makefile but in this case the logic is all run in the makefile (unlike above where the wait param is passed into the python function)
Do we want to add similar logic in the makefile too to catch ValueErrors? and if so is there a good way to raise errors in bash
(let me know if this doesnt make sense and needs more explaining!)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roberta-dt and I added this logic to the makefile in the latest commit :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@browningjp-datatonic can you please take a look at the change we made to the run command?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other place where similar logic is used in Python is for ENABLE_PIPELINE_CACHING - however this is a bit different, because it's not just True/False, but True/False/None (None default)

The compile=true and build=true flags are implemented in the Makefile itself as you say, and it's not simple to replicate the logic exactly.

For consistency in behaviour, I would suggest to modify your Python logic here to:

    if args.wait == "true":
        wait = True
    elif args.wait != "false":
        raise ValueError("wait variable must be 'true' or 'false'")
    wait = False

(value from user must be true or false exactly - case sensitive)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roberta-dt
Copy link
Collaborator

/gcbrun

@becky-dt
Copy link
Author

/gcbrun

@becky-dt
Copy link
Author

/gcbrun

@becky-dt
Copy link
Author

/gcbrun

@becky-dt becky-dt requested a review from a user August 25, 2023 08:33
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost ghost merged commit 31da0ac into develop Aug 25, 2023
@felix-datatonic felix-datatonic deleted the refactor/simplify-e2e-tests branch November 13, 2023 17:10
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants