Giter Club home page Giter Club logo

icd-rxjs's Introduction

ICD-rxjs

A couple of integration tests run by the protobuf interface and websocket via RxJS (modification from carta-frontend/src/services/BackendService.ts) method offer a white-box testing on CARTA backend.

Documentation

All the tests' designed documentations are in the google drive, access permission may required.

Build process

The build process relies heavily on npm and nodejs, so make sure they are installed and accesible. Initialise submodules and install package dependencies:

git submodule update --init --recursive
npm install
  • Building static protocol buffer code is done using the $ build_proto.sh script in the protobuf folder, which builds the static JavaScript code, as well as the TypeScript definitions, and symlinks to the node_modules/carta-protobuf directory.
cd carta-backend-ICD-rxjs/protobuf
./build_proto.sh

Run it

  • For the local computer test, set "serverURL": "ws://127.0.0.1:3002" in the src/test/config.json, where 3002 is the port number from the backend setting in this example.
  • For the server test, set "serverURL": "wss://carta.asiaa.sinica.edu.tw/socketdev" in the src/test/config.json.

Test one at a time

To avoid side effect, likely concurrent issue or IO traffic, it is better to run one test at one time. There is always a simple test from the beginning of the connection to backend, the address of which can be modified at src/test/config.json.

  • A first test could run by $ npm test src/test/ACCESS_WEBSOCKET.test.ts or $ npm test src/test/ACCESS_CARTA_DEFAULT.test.ts. As if it was failed, we might check up the parameters at config.json to fit the environment.
  • The test $ npm test src/test/FILEINFO.test.ts can help us verify the supported file formats. In case this test is failed, we may increase the timeout limitation, likely timeout.readfile or timeout.openfile at config.json.

Image download

To download the images for the test, please visit: https://carta.asiaa.sinica.edu.tw/images/ The webpage list all the needed images for each stage of the ICD test. All the images for each stage are packed into .tgz file and can be downloaded by simply clicking on the Download all files hyper link. You can also download these files through wget command by clicking on the wget button to copy the command and then paste it to your terminal for download.

icd-rxjs's People

Contributors

acdo2002 avatar ajm-ska avatar markccchiang avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

icd-rxjs's Issues

babel-jest dependency issue

A new issue has suddenly appeared on macOS12. None of the ICD tests can run. When they try to run, the following message appears:

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "babel-jest": "^24.9.0"

Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-jest was detected higher up in the tree:

  /Users/acdc/node_modules/babel-jest (version: 27.5.1) 

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "babel-jest" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
     This may help because npm has known issues with package hoisting which may get resolved in future versions.

  6. Check if /Users/acdc/node_modules/babel-jest is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

  7. Try running npm ls babel-jest in your project folder.
     This will tell you which other package (apart from the expected react-scripts) installed babel-jest.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

It seems there is a newer version of babel-jest on the system (/Users/acdc/node_modules/babel-jest) and that is conflicting with the older version used by the ICD tests. One solution may be to delete the newer version, however, it might not be the best solution if a user requires the newer dependency for something else.

I have found two working solutions:

  1. The .env workaround. When I create a file called .env containing SKIP_PREFLIGHT_CHECK=true, then the ICD tests can run successfully.

  2. I have determined that it is our react-scripts dependency that uses babel-jest. Our package.json uses react-scripts version 3.4.4, and that installs babel-jest version 24.9.0. I have tried using the latest react-scripts version which is 5.0.1. That installs babel-jest version 27..5.1 and the error is gone.

@acdo2002 Do you think we should update the react-scripts dependency in our package.json to 5.0.1?

Improve the ICD test for swap image backend PR

The backend PR#1194 add new function to support the swap images.
Then the current ICD-RxJS FILEINFO_FITS_MULTIHDU.test.ts need to update because the header description may include the axes descriptions.

e.g.
Expected: "[830, 870]"
Received: "[830, 870] (Right Ascension, Declination)"

Migration to RxJS - Part II

Will review whether they should keep in the future.
someone may duplicate to the unit tests

  • ACCESS_CARTA_DEFAULT.test.ts
  • ACCESS_CARTA_DEFAULT_CONCURRENT.test.ts
  • ACCESS_CARTA_KNOWN_SESSION.test.ts
  • ACCESS_CARTA_NO_CLIENT_FEATURE.test.ts
  • ACCESS_CARTA_SAME_ID_TWICE.test.ts
    ==================================
  • CATALOG_FITS_VOT.test.ts (including catalog streaming)
  • CATALOG_LARGE.test.ts
  • CATALOG_GENERAL.test.ts (including catalog streaming)
    ==================================
  • CLOSE_FILE_MULTI_FILES.test.ts
    ==================================
  • CONCAT_ERROR_MESSAGE.test.ts
  • CONCAT_STOKES_IMAGES.test.ts
  • CONCAT_STOKES_IMAGES_AXIS_DEGENERACY.test.ts
    ==================================
  • CONTOUR_DATA_STREAM.test.ts
  • CONTOUR_IMAGE_DATA.test.ts
  • CONTOUR_IMAGE_DATA_NAN.test.ts
  • CONTOUR_CHANGE_SMOOTH_AND_DEMICATION_FACTOR.test.ts
    ==================================
  • CURSOR_SPATIAL_PROFILE.test.ts
  • CURSOR_SPATIAL_PROFILE_NaN.test.ts
  • CURSOR_SPECTRAL_PROFILE.test.ts
  • CURSOR_SPECTRAL_PROFILE_NaN.test.ts
    ==================================
  • DS9_REGION_IMPORT_INTERNAL.test.ts
  • DS9_REGION_INFO.test.ts
    ==================================
  • SAVE_IMAGE_CHANNEL.test.ts
  • SAVE_IMAGE_CHOP.test.ts
  • SAVE_IMAGE_CHOP_SHARED.test.ts
  • SAVE_IMAGE_DROP_DEG.test.ts
  • SAVE_IMAGE_ERROR_MESSAGE.test.ts
  • SAVE_IMAGE_ORIGINAL.test.ts
  • SAVE_IMAGE_STOKES.test.ts
    ==================================
    FILEINFO_CASA.test.ts
    FILEINFO_CASA_VARIENTS.test.ts
    FILEINFO_FITS.test.ts
    FILEINFO_FITS_NONSTANDARD.test.ts
    FILEINFO_HDF5.test.ts
    FILEINFO_HDF5_COMPARE_FITS.test.ts
    FILEINFO_MIRIAD.test.ts
    FILETYPE_PARSER.test.ts
    ==================================
  • FILE_LIST_PROGRESS_CANCELLATION.test.ts
  • FILE_LIST_PROGRESS_COMPLETE.test.ts
    ==================================
  • FITS_DS9_REGION_EXPORT_IMPORT_MATCHING.test.ts
  • FITS_REGION_EXPORT_IMPORT_MATCHING.test.ts
    ==================================
  • GET_FILELIST.test.ts
    ==================================
  • IMPORT_MULTIPLE_CATALOG.test.ts
    IMPORT_MULTIPLE_IMAGE.test.ts duplicate to OPEN_IMAGE_APPEND.test.ts
  • IMPORT_MULTIPLE_REGION.test.ts
    ==================================
  • MATCH_SPATIAL.test.ts
  • MATCH_SPECTRAL.test.ts
  • MATCH_STATS.test.ts
  • MATCH_STATS_BORDERLINE.test.ts
  • MATCH_STATS_WIDE.test.ts
  • MATCH_STATS_WIDE_BORDERLINE.test.ts
    ==================================
    MOMENTS_GENERATOR_PROFILE_STREAM.test.ts
    ==================================
  • MULTI-SPECTRAL-PROFILE-IMAGE.test.ts
  • MULTI-SPECTRAL-PROFILE-POLARIZATION.test.ts
  • MULTI-SPECTRAL-PROFILE-REGION.test.ts
  • MULTI-SPECTRAL-PROFILE-STATISTIC.test.ts
    ==================================
  • OPENFILE_CASA_BEAMTABLE.test.ts
  • OPENFILE_FITS_BEAMTABLE.test.ts
  • OPEN_FITS_GZ.test.ts
  • OPEN_IMAGE_APPEND.test.ts
  • OPEN_IMAGE_CASA_VARIENTS.test.ts
  • OPEN_IMAGE_PV.test.ts
    ==================================
  • REGION_DATA_STREAM.test.ts (documentation link)
  • REGION_HISTOGRAM.test.ts (documentation link)
  • REGION_HISTOGRAM_ITERATION.test.ts
  • REGION_REGISTER.test.ts (documentation link)
  • REGION_SPECTRAL_PROFILE_ELLIPSE.test.ts (documentation link)
  • REGION_SPECTRAL_PROFILE_POLYGON.test.ts
  • REGION_SPECTRAL_PROFILE_RECTANGLE.test.ts
  • REGION_SPECTRAL_PROFILE_STOKES.test.ts

Address Sanitizer backend flag

OPEN_SWAPPED_IMAGES.test.ts may cause the carta-backend crash with building the backend with Address Sanitizer backend flag. Without the Address Sanitizer flag, backend is alive.

Should be investigate this!

check/improve MATCH_SPECTRAL.test.ts

I found the rawValuesFp64 calculation is not always the same.
Possible the decode the rawValuesFp64 to the number and compare the value directly.

Performance test migration

I would like to migrate the performance test to RxJS version from release v4 (e315a6f0).

  • PERF_LOAD_IMAGE_FITS.test.ts
  • PERF_LOAD_IMAGE_CASA.test.ts
  • PERF_LOAD_IMAGE_HDF5.test.ts
  • PERF_RASTER_TILE_DATA_FITS.test.ts
  • PERF_RASTER_TILE_DATA_CASA.test.ts
  • PERF_RASTER_TILE_DATA_HDF5.test.ts
  • PERF_CONTOUR_DATA_Mode0.test.ts
  • PERF_CONTOUR_DATA_Mode1.test.ts
  • PERF_CONTOUR_DATA_Mode2.test.ts
  • PERF_CUBE_HISTOGRAM_FITS.test.ts
  • PERF_CUBE_HISTOGRAM_CASA.test.ts
  • PERF_CUBE_HISTOGRAM_HDF5.test.ts
  • PERF_REGION_SPECTRAL_PROFILE_FITS.test.ts
  • PERF_REGION_SPECTRAL_PROFILE_CASA.test.ts
  • PERF_REGION_SPECTRAL_PROFILE_HDF5.test.ts
  • PERF_ANIMATION_PLAYBACK_FITS.test.ts
  • PERF_ANIMATION_PLAYBACK_CASA.test.ts
  • PERF_ANIMATION_PLAYBACK_HDF5.test.ts
  • PERF_MOMENTS_FITS.test.ts
  • PERF_MOMENTS_CASA.test.ts
  • PERF_MOMENTS_HDF5.test.ts
  • PERF_PV_FITS.test.ts
  • PERF_PV_CASA.test.ts
  • PERF_PV_HDF5.test.ts

Add one more test to tile-related ICD-RxJS

Because this frontend PR
We need to add one tile related test to test the condition that open two file and set channel and set stoke of inactive file.

  • Documentation
  • Implementation

Failures due to the FileID

Because the fileID has been updated in the carta-backend
the corresponding tests: image fitting, PV, and moment should be updated
the functional message would be fine, the failures come from the new generated image (fileId)

Remove Processed.ts

Keep ICD-RxJS tests just check the protobuf messages: correction and execution time with different platforms
So remove Processed.ts from any branch and check rawValuesFp64 directly. Leave rawValuesFp64 => value checking work to the frontend unit tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.