Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

chore: move examples to external repo #3821

Merged

Conversation

oliveriosousa
Copy link
Contributor

@oliveriosousa oliveriosousa commented Aug 17, 2021

UPDATE:

  • Update .md files and add links to point to the new examples org/repos
  • Remove scripts related with example tests
  • Close the existing PRs against the current examples folder

CC @hugomrdias @achingbrain

@achingbrain
Copy link
Member

achingbrain commented Aug 17, 2021

Could you please also:

  • update the various .md files and/or add links to point to the new examples org/repos.
  • Remove the release:post:update-example-dependencies step from the build and supporting files
  • Remove the various configure-examples npm scripts
  • Ensure the examples are actually tested in CI
  • Close the existing PRs against the current examples folder

@achingbrain
Copy link
Member

Also, it'd be nice to test the examples individually as it's the longest build step by far so good to break it into chunks.

@oliveriosousa oliveriosousa force-pushed the feat/move-examples-to-external-repo branch 2 times, most recently from 2fa3c21 to 6bf176d Compare August 23, 2021 15:23
@achingbrain
Copy link
Member

achingbrain commented Aug 23, 2021

It'd be great to get this merged. I think the last thing to do is to test the examples individually.

By which I mean instead of:

    - stage: test
      name: examples
      script:
        # Travis lets scripts continue even if previous steps fail so need to use &&: https://github.com/travis-ci/travis-ci/issues/1066
        - npm run configure-examples &&
          npm run test -- $RUN_SINCE --scope=example* --concurrency=1

Do:

    - stage: test
      name: examples - ipfs-http-client upload file
      script:
        - npm run test:external -- -- -- https://github.com/ipfs-examples/js-ipfs-http-client-upload-file.git

    - stage: test
      name: examples - ipfs-http-client bundle webpack
      script:
        - npm run test:external -- -- -- https://github.com/ipfs-examples/js-ipfs-http-client-bundle-webpack.git

    - stage: test
      name: examples - ipfs browser webpack
      script:
        - npm run test:external -- -- -- https://github.com/ipfs-examples/js-ipfs-browser-webpack.git

// etc

..so that all the example tests run in parallel.

It looks like the repos under ipfs-exmaples/* don't declare a "test" npm script, instead using "test:example" so that will need to change, which it probably should because "test" is the canonical name.

They also appear to use the playwright cli command without declaring it as a dev dep, so they should declare it as a dev dep otherwise it needs the user to have it installed globally, which is too much magic for an example.

@oliveriosousa
Copy link
Contributor Author

Hi @achingbrain,

Thanks for the explanation but it raises some concerns.
That way every time a new example is added to ipfs-example we must add a new entry in the travis file. If we leave as is, it is not needed to make any changes to the repo from now on.

Can we make this improvement of having tests running in parallel done in the other repo?

@oliveriosousa oliveriosousa force-pushed the feat/move-examples-to-external-repo branch from 6bf176d to d7557a0 Compare August 23, 2021 18:41
@achingbrain
Copy link
Member

That way every time a new example is added to ipfs-example we must add a new entry in the travis file. If we leave as is, it is not needed to make any changes to the repo from now on.

This is true, but are you expecting a large amount of churn in the number of examples to be added over time? If not, adding new entries may not be a huge burden.

Furthermore adding examples to the the ipfs-example org could end up changing the work the js-ipfs build needs to do between runs which makes it less deterministic.

Can we make this improvement of having tests running in parallel done in the other repo?

This will still run in a single travis runner though, right? Historically they've been too weak to do things like run multiple browser based tests simultaneously.

@oliveriosousa oliveriosousa force-pushed the feat/move-examples-to-external-repo branch from e9e300d to 36ad4bd Compare August 24, 2021 13:49
@achingbrain achingbrain changed the title feat: move examples to external repo chore: move examples to external repo Aug 25, 2021
@achingbrain achingbrain merged commit 1806bb2 into ipfs:master Aug 25, 2021
SgtPooki referenced this pull request in ipfs/js-kubo-rpc-client Aug 18, 2022
- Removes all the examples from this repository
- Change CI to execute the test examples from external repo (https://github.com/ipfs-examples/js-ipfs-examples.git)
- Update `.md` files and add links to point to the new examples org/repos
- Remove scripts related with example tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants