Skip to content

Commit

Permalink
fix: pin ic-certification v2.4.0 (#1042)
Browse files Browse the repository at this point in the history
* fix: pin ic-certification v2.4.0

Signed-off-by: David Dal Busco <[email protected]>

* test: more timeout

Signed-off-by: David Dal Busco <[email protected]>

* test: slow test in CI

Signed-off-by: David Dal Busco <[email protected]>

---------

Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker authored Jan 10, 2025
1 parent 7e89176 commit 136df2f
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 72 deletions.
4 changes: 2 additions & 2 deletions src/libs/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ ic-stable-structures.workspace = true
sha2.workspace = true
hex.workspace = true
serde_bytes = "0.11.12"
ic-certification = "2.4.0"
ic-representation-independent-hash = "2.4.0"
ic-certification = {version = "= 2.4.0"}
ic-representation-independent-hash = {version = "= 2.4.0"}
regex.workspace = true
base64 = "0.13.1"
url = "2.4.0"
Expand Down
144 changes: 76 additions & 68 deletions src/tests/orbiter.upgrade-configuration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,76 +104,84 @@ describe('Orbiter upgrade- Configuration', () => {
expect(fromNullable(configs[0][1].features)).toBeUndefined();
});

it('should migrate configuration enabled to the new features', async () => {
const { set_satellite_configs } = actor;

await expect(
set_satellite_configs([
[
satelliteIdMock,
{
version: [],
enabled: true
}
]
])
).resolves.not.toThrowError();

await upgradeVersion();

const newActor = pic.createActor<OrbiterActor>(idlFactorOrbiter, canisterId);
newActor.setIdentity(controller);

const { list_satellite_configs } = newActor;

const configs = await list_satellite_configs();
expect(configs.length).toBe(1);

expect(configs[0][0].toText()).toEqual(satelliteIdMock.toText());
expect(fromNullable(configs[0][1].version)).toBe(1n);
expect(fromNullable(configs[0][1].features)).toEqual({
page_views: true,
performance_metrics: true,
track_events: true
});
});
it(
'should migrate configuration enabled to the new features',
async () => {
const { set_satellite_configs } = actor;

await expect(
set_satellite_configs([
[
satelliteIdMock,
{
version: [],
enabled: true
}
]
])
).resolves.not.toThrowError();

await upgradeVersion();

const newActor = pic.createActor<OrbiterActor>(idlFactorOrbiter, canisterId);
newActor.setIdentity(controller);

const { list_satellite_configs } = newActor;

const configs = await list_satellite_configs();
expect(configs.length).toBe(1);

expect(configs[0][0].toText()).toEqual(satelliteIdMock.toText());
expect(fromNullable(configs[0][1].version)).toBe(1n);
expect(fromNullable(configs[0][1].features)).toEqual({
page_views: true,
performance_metrics: true,
track_events: true
});
},
{ timeout: 60000 }
);
});

describe('v0.0.7 -> v0.0.8 -> current', () => {
it('should migrate configuration enabled to the new features', async () => {
const { set_satellite_configs } = actor;

await expect(
set_satellite_configs([
[
satelliteIdMock,
{
version: [],
enabled: true
}
]
])
).resolves.not.toThrowError();

await upgradeVersion();

await upgradeCurrent();

const newActor = pic.createActor<OrbiterActor>(idlFactorOrbiter, canisterId);
newActor.setIdentity(controller);

const { list_satellite_configs } = newActor;

const configs = await list_satellite_configs();
expect(configs.length).toBe(1);

expect(configs[0][0].toText()).toEqual(satelliteIdMock.toText());
expect(fromNullable(configs[0][1].version)).toBe(1n);
expect(fromNullable(configs[0][1].features)).toEqual({
page_views: true,
performance_metrics: true,
track_events: true
});
});
it(
'should migrate configuration enabled to the new features',
async () => {
const { set_satellite_configs } = actor;

await expect(
set_satellite_configs([
[
satelliteIdMock,
{
version: [],
enabled: true
}
]
])
).resolves.not.toThrowError();

await upgradeVersion();

await upgradeCurrent();

const newActor = pic.createActor<OrbiterActor>(idlFactorOrbiter, canisterId);
newActor.setIdentity(controller);

const { list_satellite_configs } = newActor;

const configs = await list_satellite_configs();
expect(configs.length).toBe(1);

expect(configs[0][0].toText()).toEqual(satelliteIdMock.toText());
expect(fromNullable(configs[0][1].version)).toBe(1n);
expect(fromNullable(configs[0][1].features)).toEqual({
page_views: true,
performance_metrics: true,
track_events: true
});
},
{ timeout: 60000 }
);
});
});
4 changes: 2 additions & 2 deletions src/tests/orbiter.upgrade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ describe('Orbiter upgrade', () => {
expect('Err' in results).toBeFalsy();
});
},
{ timeout: 600000 }
{ timeout: 1200000 }
);

describe(
Expand Down Expand Up @@ -394,7 +394,7 @@ describe('Orbiter upgrade', () => {
expect('Err' in results).toBeFalsy();
});
},
{ timeout: 600000 }
{ timeout: 1200000 }
);
});
});

0 comments on commit 136df2f

Please sign in to comment.