Skip to content

REsolve "Adapt test data for docker compose testing environment"

Closes #333 (closed) To be used together with https://gitlab.esrf.fr/icat/icat-compose

and with the config file .env.test.local:

LOGBOOK_API_KEY="elogbook-be70ac55-fd08-4840-9b29-b73262958ca8"
ICAT_SERVER_URL="http://127.0.0.1"
ICAT_SERVER_PORT=8080

MONGO_DB_URL=

#LOGGING_LEVEL="silly"
LOGGING_LEVEL="0"

ELASTIC_SEARCH_SERVER=

ICAT_ADMIN_USERNAME="userGroupReader"
ICAT_ADMIN_PASSWORD="userGroupReader"

ICAT_MINTING_USERNAME="minter"
ICAT_MINTING_PASSWORD="minter"

ICAT_MINTING_GROUP="minters"
ICAT_LISTREADER_USERNAME="minter"
ICAT_LISTREADER_PASSWORD="minter"

ICAT_NOTIFIER_USERNAME="notifier"
ICAT_NOTIFIER_PASSWORD="notifier"

ICAT_INVESTIGATIONS_READER_USERNAME="notifier"
ICAT_INVESTIGATIONS_READER_PASSWORD="notifier"

ICAT_DATAACQUISITION_USERNAME="dataacquisition"
ICAT_DATAACQUISITION_PASSWORD="dataacquisition"

ICAT_ANONYMOUS_USERNAME="reader"
ICAT_ANONYMOUS_PASSWORD="reader"

DATACITE_PASSWORD="TEST"
DATACITE_USERNAME="TEST"

and global.resource:

module.exports = {
  investigationTypes: {
    industrials: ["FX", "IX", "IN", "IM"],
  },
  instruments: [
    {
      name: "BEAMLINE-01",
    },
    {
      name: "BEAMLINE-02",
    },
  ],
  doi: {
    public: [
      { prefix: "TESTING", suffix: "DOI-TEST-0003" },
      { prefix: "TESTING", suffix: "DOI-TEST-0003" },
    ],
  },
  addresses: {
    valid: {
      complete: {
        name: "Jonh",
        surname: "Doe",
        companyName: "ESRF",
        address: "RUE DE LA POSTE",
        city: "Grenoble",
        region: "Rhone-Alpes/Isere",
        postalCode: "38000",
        email: "esrf@esrf.fr",
        phoneNumber: "123123123",
        country: "France",
      },
    },
  },
  users: {
    principalInvestigator: {
      credential: {
        plugin: "db",
        username: "principalInvestigator",
        password: "principalInvestigator",
      },
      investigation: {
        principalInvestigator: {
          investigationId: 1,
        },
      },
    },
    localContact: {
      credential: {
        plugin: "db",
        username: "localContact",
        password: "localContact",
      },
      investigation: {
        principalInvestigator: {
          investigationId: 1,
        },
      },
    },
    administrator: {
      name: "admin",
      fullName: "adminFullName",
      credential: {
        plugin: "db",
        username: "admin",
        password: "admin",
      },
      investigations: {
        administrator: {
          investigationId: 5,
        },
      },
    },
    anonymous: {
      name: "reader",
      email: "reader@reader.com",
      credential: {
        plugin: "db",
        username: "reader",
        password: "reader",
      },
      investigations: {
        underEmbargo: {
          investigationId: 2,
        },
        released: {
          investigationId: 4,
        },
      },
    },
    minter: {
      name: "minter",
      credential: {
        plugin: "db",
        username: "minter",
        password: "minter",
      },
    },

    instrumentScientist: {
      name: "instrumentScientist",
      fullName: "instrumentScientistFullName",
      credential: {
        plugin: "db",
        username: "instrumentScientist",
        password: "instrumentScientist",
      },
      instrument: { name: "BEAMLINE-01" },
      investigations: {
        instrumentScientist: {
          investigationId: 1,
          instrumentName: "BEAMLINE-01",
        },
      },
    },
    investigationUser: {
      name: "investigationUser",
      fullName: "investigationUserFullName",
      email: "investigationUser@investigationUser.com",
      credential: {
        plugin: "db",
        username: "investigationUser",
        password: "investigationUser",
      },
      investigations: {
        participates: [
          {
            investigationId: 1,
            investigationName: "TEST-0001",
            instrumentName: "BEAMLINE-01",
            datasets: {
              datasetWithNoSample: {
                id: 1,
                fileCount: 1,
              },
              datasetWithSample: {
                id: 2,
                fileCount: 6,
                parameters: [
                  {
                    id: 2,
                  },
                ],
              },
              datasetWithNoSampleNoDataCollection: {
                id: 2,
                fileCount: 6,
              },
            },
            samples: [
              {
                id: 1,
              },
            ],
          },
          {
            investigationId: 2,
            investigationName: "TEST-0001",
            instrumentName: "BEAMLINE-02",
          },
        ],
        noAccess: {
          investigationId: 7,
        },
        underEmbargo: {
          investigationId: 5,
        },
        timeSlots: {
          investigationId: 3,
          investigationName: "TEST-0002",
          instrumentName: "BEAMLINE-02",
          visitId: "26-08-2020 BEAMLINE-02",
        },
      },
    },

    allowed: [
      {
        plugin: "db",
        username: "reader",
        password: "reader",
      },
    ],
    denied: [
      {
        plugin: "db",
        username: "reader",
        password: "badpassword",
      },
    ],
  },
};
Edited by Alejandro De Maria Antolinos

Merge request reports

Loading