node-gradle / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
615 stars 119 forks source link

Add HTTPS support to integration tests #195

Open deepy opened 3 years ago

deepy commented 3 years ago

With no changes in the code we've started getting failures like this:

java.lang.AssertionError: Request not found exactly once, expected:<{
          "method" : "GET",
          "path" : "/case",
          "headers" : {
            "Host" : [ "registry.npmjs.org:80" ]
          },
          "secure" : false
        }> but was:<{
          "method" : "POST",
          "path" : "/-/npm/v1/security/audits/quick",

We probably just need to disable audits in the integration tests since we're mocking for proxy testing purposes.

deepy commented 3 years ago

Can be disabled with NPM_CONFIG_AUDIT

deepy commented 3 years ago

Setting the ENV on the entire workflow didn't help and neither did adding a .npmrc with audit = "false"

deepy commented 3 years ago

NpmProxy_integTest fails consistently for me locally, first run of install packages using proxy fails, second works.

If I replace proxyMockServer = startClientAndServer(PortFactory.findFreePort()) with any port at all, both tests pass

deepy commented 3 years ago

Possibly unrelated, but github is turning off non-HTTPS access to npm soon https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/

deepy commented 3 years ago

It was the non-HTTPS access

deepy commented 2 years ago

Configuration documentation https://www.mock-server.com/mock_server/configuration_properties.html