Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [no-issue] upgrade to v1020 of Web SDK and migrate to ng cli #25

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

reey
Copy link
Member

@reey reey commented Jan 25, 2024

Proposed changes

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Signed-off-by: Tristan Bastian <tristan.bastian@softwareag.com>
@reey reey self-assigned this Jan 25, 2024
@jdreSAG
Copy link
Collaborator

jdreSAG commented Jun 5, 2024

currently there is an issue with tests. I guess all of them might have one origin, as most of them which are failing are time-related.
one of them, a little bit modified for debugging:

it.only('should return resolved data', fakeAsync(() => {
  // when
  const values = { [new Date().toString()]: [{ min: 0, max: 1 }] };
  (global as any).fetch = jest.fn().mockImplementationOnce(() =>
    Promise.resolve({
      json: () => ({ values } as ISeries),
    })
  );
  console.log('before sub', new Date().toISOString())
  let resolvedData;
  service.listSeries$({} as any).subscribe((val) => {
    console.log('sub callback', new Date().toISOString());
    resolvedData = val.data;
  });
  tick(1000);
  console.log('after tick', new Date().toISOString());

  // then
  expect(resolvedData.values).toEqual(values);
}));

and order of console.logs is:

-console.log
before sub 2024-06-05T10:44:30.924Z
-console.log
after tick 2024-06-05T10:44:31.924Z
-console.log
sub callback 2024-06-05T10:44:30.991Z

So dates are looking fine, 'after tick' is called 1000ms after 'before sub'. and 'sub callback' date is between them (which is ok), but order should be

  • before sub
  • sub callback
  • after tick

expect is called after 'after tick' but before 'sub callback' so it's still undefined. flush does not work. fixture.detectChanges is not a case, there is no fixture, this is service test suite. and I don;t really want to switch to waitForAsync, other test cases (much more complicated and time related) are also failing. I tried with async and used await approach by converting observable to Promise and it worked.

Dawid Janusz and others added 9 commits June 11, 2024 11:21
Signed-off-by: Tristan Bastian <tristan.bastian@softwareag.com>
Signed-off-by: Tristan Bastian <tristan.bastian@softwareag.com>
Signed-off-by: Tristan Bastian <tristan.bastian@softwareag.com>
Bug fix for setting new time range when realtime is enabled.
n/a
update ts and zone.js

n/a
update c8y packages

n/a
update c8y packages, angular packages and other upgrades

n/a
@jdreSAG jdreSAG changed the title feat: [no-issue] upgrade to v1019 of Web SDK and migrate to ng cli feat: [no-issue] upgrade to v1020 of Web SDK and migrate to ng cli Jun 19, 2024
@jdreSAG
Copy link
Collaborator

jdreSAG commented Jun 19, 2024

currently there is an issue with tests. I guess all of them might have one origin, as most of them which are failing are time-related. one of them, a little bit modified for debugging:

it.only('should return resolved data', fakeAsync(() => {
  // when
  const values = { [new Date().toString()]: [{ min: 0, max: 1 }] };
  (global as any).fetch = jest.fn().mockImplementationOnce(() =>
    Promise.resolve({
      json: () => ({ values } as ISeries),
    })
  );
  console.log('before sub', new Date().toISOString())
  let resolvedData;
  service.listSeries$({} as any).subscribe((val) => {
    console.log('sub callback', new Date().toISOString());
    resolvedData = val.data;
  });
  tick(1000);
  console.log('after tick', new Date().toISOString());

  // then
  expect(resolvedData.values).toEqual(values);
}));

and order of console.logs is:

-console.log before sub 2024-06-05T10:44:30.924Z -console.log after tick 2024-06-05T10:44:31.924Z -console.log sub callback 2024-06-05T10:44:30.991Z

So dates are looking fine, 'after tick' is called 1000ms after 'before sub'. and 'sub callback' date is between them (which is ok), but order should be

  • before sub
  • sub callback
  • after tick

expect is called after 'after tick' but before 'sub callback' so it's still undefined. flush does not work. fixture.detectChanges is not a case, there is no fixture, this is service test suite. and I don;t really want to switch to waitForAsync, other test cases (much more complicated and time related) are also failing. I tried with async and used await approach by converting observable to Promise and it worked.

issue fixed.

Replace all occurrences of "browserTarget" with "buildTarget" in the angular.json file.

n/a
Cypress tests updated according to new layout of context dashboard.

n/a
Case/typo fix

n/a
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.

None yet

2 participants