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

Create dummy DB adapter repo that runs Parse Sever tests #8788

Closed
3 tasks done
mtrezza opened this issue Oct 23, 2023 · 5 comments · Fixed by #8883
Closed
3 tasks done

Create dummy DB adapter repo that runs Parse Sever tests #8788

mtrezza opened this issue Oct 23, 2023 · 5 comments · Fixed by #8883
Labels
type:ci CI related issue

Comments

@mtrezza
Copy link
Member

mtrezza commented Oct 23, 2023

New Feature / Enhancement Checklist

Feature / Enhancement Description

This purpose of this issue is to centralize the discussion around how to create a dummy DB adapter repo as a POC to demonstrate the test exclusion list feature while running the full Parse Server test suite externally.

It should probably work like so:

  1. The adapter repo CI downloads the full Parse Server repo directly from GitHub based on a version tag. To ensure the adapter is compatible with specific versions, the CI could use a matrix to download multiple Parse Server major versions, e.g. the latest 5.x and 6.x. Downloading from npm wouldn't contain the tests as they are stripped from the published package.
  2. The CI modifies the DB adapter that Parse Server uses to run the tests. This may require some login the Parse Server repo test helper logic.
  3. The CI overrides the textExclusionList.json in Parse Server with the file defined in the adapter repo. So that Parse Server will exclude these tests. Or maybe more elegant, add an optional path param to the npm test command, so the CI just starts the CI by passing the file path.
@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 23, 2023

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza mtrezza added the type:feature New feature or improvement of existing feature label Oct 23, 2023
@mtrezza mtrezza added type:ci CI related issue and removed type:feature New feature or improvement of existing feature labels Oct 23, 2023
@mtrezza
Copy link
Member Author

mtrezza commented Oct 25, 2023

@ddrechse
Copy link
Contributor

Hi @mtrezza

I cloned the template repo and have a few questions

  1. there is no .github folder and no ci.yml so how to clone parse server repo during build

  2. None of the spec files currently in parse server repo have a uuid so testing exclusion won't work
    For this one, maybe make a branch off alpha and just add uuids to a few tests in diff specs

  3. How to verify that the tests have been excluded at the end of the build

Thnks

@mtrezza
Copy link
Member Author

mtrezza commented Oct 25, 2023

  1. The repo is empty, constructing the CI is part of the challenge, but I imagine to use parse server's ci.yml as a basis.
  2. That's correct; we would need to add an ID to a few tests where in a separate PR.
  3. The same way as in Parse Server. If we go with the suggested concept in Create dummy DB adapter repo that runs Parse Sever tests #8788 (comment) then this repo will just copy the parse-server repo and run the test workflow the same way as in parse-server'S ci.yml file.

@ddrechse
Copy link
Contributor

The goal here is to provide a generic way that any new Parse Adapter repo can configure their own test exclusions.
I am NOT a gihub actions guy but this is the idea as I understand it
Here is an example

name: ci

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  clone-parse-server:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version: ['5.0.0', '6.0.0']
    steps:
    - name: Checkout code
      uses: actions/checkout@v2
    - name: Clone parse-server ${{ matrix.version }}
      run: |
        git clone --depth 1 --branch ${{ matrix.version }} https://github.com/parse-community/parse-server.git parse-server-${{ matrix.version }}
    - name: Set test exclusion list
      run: # ...
    - name: Run CI
      run: npm run test

there would be a ci.yml in the adapter repo obviously cause you would need it to clone parse server repo
I would imagine that in the root of the adapter repo, you could clone parse server into a subdirectory and then copy the specific adapter files into the corresponding sub-directory adapter location, cd into it and then run npm test as usual

From a discussion with @mtrezza
You see, in the workflow, the steps are repeated 2 times, once for each version of Parse Server
It clones Parse Server 5 into a directly, directly from GitHub, including all the test files, basically the whole repo
Then you would just replace the test exclusion list by overwriting the file.
set the db adapter
Then you run the Parse Server CI
I would break this all down and start wit this simple example here
The first step would be to run the CI of cloned Parse Server
Forgetting about test exclusions for a moment.
Once this works, I would look at setting the test exclusion list by adding that step
After that, I would look at how to replace the DB adapter, so that the test don’t run with the default adapter of the Parse Server repo, but with the adapter that you use in the DB adapter repository

Lastly, an automated way to verify that the tests have been excluded at the end of the build :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:ci CI related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants