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

Add format and test scripts #1987

Merged
merged 15 commits into from
Jul 10, 2023
Merged

Add format and test scripts #1987

merged 15 commits into from
Jul 10, 2023

Conversation

adam-narozniak
Copy link
Member

@adam-narozniak adam-narozniak commented Jun 30, 2023

Issue

The baseline created using the updated way doesn't have the format and test scripts. Additionally, they differ slightly - each has its own pyproject.toml

Description

The test scripts include:

  • structure (whether they follow the baseline_template structure)
  • formatting (similar to the main flwr code)

Related issues/PRs

NA

Proposal

Create a script that checks a single baseline.

Explanation

Baselines have to be checked individually since they have different pyproject.tomls. Additionally, check performed on-baseline-basis will help to run only the CI test for the baseline that was modified (all baseline checks, according to me is not feasible to singe the env setup for a single baseline is ~3 minutes, and we plan on having 50 baselines).

The test and format work as follows:
./dev/test-baseline.sh

  • Structure tests might be relaxed (in rare cases) by adding the directory to the structure_exceptions=() in test-baseline-structure.sh
  • The unit tests are executed only when they are present.
    python -m pytest . || ([ $? -eq 5 ] || [ $? -eq 0 ])
    The 5 return status means: no test detected. The 0 return status means correctly executed. We accept both.

@jafermarq
Copy link
Contributor

@adam-narozniak @danieljanes should we include this before we launch SoR? at the very least the formatting script?

@adam-narozniak adam-narozniak marked this pull request as ready for review July 7, 2023 13:46
@adam-narozniak adam-narozniak enabled auto-merge (squash) July 7, 2023 13:47
@adam-narozniak
Copy link
Member Author

adam-narozniak commented Jul 7, 2023

@jafermarq I think we should add it, now it's ready. There will be a next PR that will automatically test only the changed baseline in the CI, but ppl can use that locally for testing and formatting.

@jafermarq
Copy link
Contributor

jafermarq commented Jul 7, 2023

@adam-narozniak, i feel like we should provide instructions for people to know how to run the format-baseline.sh? For example something like.

# the top level directory for baselines run after sourcing your environment:
./dev/format_baseline.sh <name-of-you-baseline>

Also, i think we need to add ruff to the pyproject.toml in the baseline? and also, how about doing chmod +x to the script? so people can just run it directly?

Maybe you can do the chmod +x thing and i'll create another PR for changes to the baseline-template. 👍

@adam-narozniak adam-narozniak merged commit d7cbf47 into main Jul 10, 2023
@adam-narozniak adam-narozniak deleted the add-baseline-scripts branch July 10, 2023 12:20
tanertopal added a commit that referenced this pull request Jul 11, 2023
* main:
  Add new baselines test github workflow (#2009)
  Add simulation to E2E tests (#2074)
  Add E2E test for Pandas (#2070)
  Add E2E test for scikit-learn (#2073)
  Add format and test scripts (#1987)
  Add missing ruff dependency to baselines (#2075)
  Add E2E test for MXNet (#2069)
  Add E2E test for Jax (#2067)
  Update bare E2E test client (#2068)
  Update PyTorch E2E test (#2072)
  Update Tensorflow E2E test (#2071)
  Fix flake8 error E266 in baseline template (#2065)
  Fix baseline creation on linux-based systems (#2063)
  Updates to Baseline Template Readmes (#2059)
  Refresh FedProx MNIST baseline (#1918)
  Extend test checking tools config (#1986)
  Improved documentation (#2006)
  updated material for 30min FL tutorial (#2005)
  Update codeowners list (#2004)
  Create and delete nodes via Fleet API (#1901)
alessiomora pushed a commit to alessiomora/flower that referenced this pull request Aug 30, 2023
* Add code quality tests
* Add a structure test
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.

2 participants