HSLdevcom / jore4

Public transport registry
European Union Public License 1.2
4 stars 2 forks source link

Create datasets for e2e basedata #1720

Open HenrikHartiala opened 3 months ago

HenrikHartiala commented 3 months ago

The nature of this ticket is different, therefore it was accepted that the size can be L.

Currently many of the e2e test files have 200-500 lines of code on top of the file just creating the base data for the tests. This is mainly just noise and there are a lot of similarities in this data between tests and majority of this data is just copy paste. Some of the tests have additions or modifications to this data for some specific reason. Would be nicer to not copy paste the same base data creation in every test file. Also some of the specific tests that have more base data, would probably be of help in the other test files as well and make the other tests more reliable at the same time.

NOTE: some of the base data has already been used in "two different ways". For example:

const testInfraLinks = [
  {
    externalId: '445156',
    coordinates: [24.926699622176628, 60.164181083308065, 10.0969999999943],
  },
  {
    externalId: '442424',
    coordinates: [24.92904198486008, 60.16490775039894, 0],
  },
  {
    externalId: '442325',
    coordinates: [24.932072417514647, 60.166003223527824, 0],
  },
];

And in another file:

export const testInfraLinks = [
  {
    externalId: '445156',
    coordinates: [24.925682785, 60.163824160000004, 7.3515],
  },
  {
    externalId: '442424',
    coordinates: [24.929825718, 60.165285984, 9.957],
  },
  {
    externalId: '442325',
    coordinates: [24.93312261043133, 60.16645636069328, 13.390046659939703],
  },
];

The same externalIds are used, but the coordinates differ for some particular reason and it would be nice to check and unify these.

EDIT: It seems that the coordinates are not related to the infraLinks at all, so this needs to be refactored first. They are stop coordinates and at least at a first glance do not have any connection with infralinks?

After we have created the datasets for test base data, it will be nice that when we need to expand the data, this data can be expanded to other tests as well. Of course the other tests will need to be adjusted according to data changes, but that will just make the tests more reliable.

NOTE: The test data seems to be off in many places and should be corrected. This will be corrected when we use the datasets, but that will take some time because the tests need to be checked one by one.

Related: #1635 . This ticket is nicer to do after we have the datasets. And actually it might even be that the dataset unification will already be enough for this ticket.

Make necessary documents.

HenrikHartiala commented 2 months ago

https://dev.azure.com/hslfi/JORE%204.0/_workitems/edit/35338