Skip to content

feat: verdaccio for acceptance test#959

Closed
juanpicado wants to merge 4 commits into
yarnpkg:masterfrom
juanpicado:feat-verdaccio-acceptance-test
Closed

feat: verdaccio for acceptance test#959
juanpicado wants to merge 4 commits into
yarnpkg:masterfrom
juanpicado:feat-verdaccio-acceptance-test

Conversation

@juanpicado
Copy link
Copy Markdown
Contributor

@juanpicado juanpicado commented Feb 16, 2020

What's the problem this PR addresses?

Current acceptance-test are based on a mocked registry and each new scenario might need to modify that server and increase complexity, more code to maintain and less intuitive configuration.

How did you fix it?

The proposal is to use Verdaccio instead as a registry server. There are a few advantages of this migration:

  • No need to modify pkg-tests-fixtures at all. All fixtures packages will be published in the setup phase.
  • Include custom authentification plugin to make much easier the current auth model.

What's missing? This is just a wip PoC (just limited to one test file) with the idea to discover challenges

  • Add verdaccio as a dependency
  • Add custom configuration
  • Pre publish fixtures packages: This is required otherwise verdaccio won't be able to find any package
  • Enable all tests
  • Add test documentation
  • Clean up (a bit messy now)

I creating this as a draft because still too much work to do, but I just wanna share current progress in order to get early feedback (and I need the CI to verify all works properly).

Copy link
Copy Markdown
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

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

That's a good idea! One particular thing is that our mock server is also able to serve git repositories (to test fetching Git packages) - can we do this with the verdaccio API (just add routes that we handle ourselves)?

@@ -0,0 +1,37 @@
storage: /Users/jpicado/.local/share/verdaccio/storage_yarn
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess this won't work everywhere :p

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hehe ... yeah the idea is create a temp folder and publish all fixture packages there on the setup phase. For now I am working in that part, I managed to publish but I don’t know how to invoke ‘yarn publish’ programmatically with the dev version. I did it using exec with npm ☺️) just for proving works my approach.

@juanpicado
Copy link
Copy Markdown
Contributor Author

We can add a middleware plugin adding new endpoints and that might work.

@juanpicado
Copy link
Copy Markdown
Contributor Author

@arcanis I'll close this, I'm having no much time lately and also there is a bug with the Node API which I was aiming to use here. I'll try again when I get more time.

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