Skip to content

Commit

Permalink
chore: Change the audio url for tests to a local one to avoid connect…
Browse files Browse the repository at this point in the history
…ion issues which cause test flakes (#6009)

### PR fulfills these requirements
- [X] Commit message(s) and PR title follows the format
`[fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made`
ex. `fix: DEV-XXXX: Removed inconsistent code usage causing intermittent
errors`
- [X] Tests for the changes have been added/updated (for bug
fixes/features)
- [ ] Docs have been added/updated (for bug fixes/features)
- [X] Best efforts were made to ensure docs/code are concise and
coherent (checked for spelling/grammatical errors, commented out code,
debug logs etc.)
- [X] Self-reviewed and ran all changes on a local instance (for bug
fixes/features)



#### Change has impacts in these area(s)
_(check all that apply)_
- [ ] Product design
- [ ] Backend (Database)
- [ ] Backend (API)
- [X] Frontend



### Describe the reason for change

Currently we have seen test flakes occur in the audio related tests. The
failure is always the same, it is a failed to fetch the audio url error
which is thrown by various tests which are using an s3 url. To stabilize
and remove this from being a possible test failure I moved the tests to
use a locally sourced version of the same file.


### Does this PR introduce a breaking change?
_(check only one)_
- [ ] Yes, and covered entirely by feature flag(s)
- [ ] Yes, and covered partially by feature flag(s)
- [X] No
- [ ] Not sure (briefly explain the situation below)



### What level of testing was included in the change?
_(check all that apply)_
- [X] e2e
- [X] integration
- [X] unit



### Which logical domain(s) does this change affect?
Tests which include Audio tag.
  • Loading branch information
bmartel committed Jun 18, 2024
1 parent 6580e25 commit ef63bed
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion web/libs/editor/tests/e2e/examples/audio-paragraphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config = `
`;

const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
text: [
{
end: 5.6,
Expand Down
2 changes: 1 addition & 1 deletion web/libs/editor/tests/e2e/examples/audio-regions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const config = `
`;

const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
};

const result = [
Expand Down
2 changes: 1 addition & 1 deletion web/libs/editor/tests/e2e/examples/classification.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const config = `
`;

const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
};

const result = [
Expand Down
2 changes: 1 addition & 1 deletion web/libs/editor/tests/e2e/examples/text-paragraphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config = `
`;

const data = {
audio: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
audio: "/public/files/barradeen-emotional.mp3",
dialogue: [
{
start: 3.1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const config = `
`;

const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
};

const annotations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const configSpeech = `
`;

const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
};

const annotations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const configSpeech = `
`;

const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
};

const annotations = [
Expand Down
2 changes: 1 addition & 1 deletion web/libs/editor/tests/e2e/tests/maxUsage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Data(maxUsageDataTable).Scenario(
<Audio name="audio" value="$audio" />
</View>`,
data: {
audio: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
audio: "/public/files/barradeen-emotional.mp3",
},
});

Expand Down
2 changes: 1 addition & 1 deletion web/libs/editor/tests/e2e/tests/paragraphs-filter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { omitBy } = require("./helpers");

Feature("Paragraphs filter");

const AUDIO = "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3";
const AUDIO = "/public/files/barradeen-emotional.mp3";

const ANNOTATIONS = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Feature("Hotkeys").tag("@regress");

const AUDIO_URL = "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3";
const AUDIO_URL = "/public/files/barradeen-emotional.mp3";

Scenario("Hotkeys on re-initing lsf", async ({ I, LabelStudio, AtAudioView, AtSidebar }) => {
const params = {
Expand Down
2 changes: 1 addition & 1 deletion web/libs/editor/tests/e2e/tests/shortcuts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const configParams = new DataTable(["inline"]);
configParams.add([inline]);
});

const AUDIO_URL = "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3";
const AUDIO_URL = "/public/files/barradeen-emotional.mp3";

const TEXT_SELECTOR = "[name='text']";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const configWithScroll = `
`;

const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
text: [
{
end: 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const config = `
`;

const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
text: [
{
end: 5.6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const config = `
`;

const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
};

const annotations = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const config = `
`;

export const data = {
url: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
url: "/public/files/barradeen-emotional.mp3",
text: [
{
text: "Dont you hate that?",
Expand Down
4 changes: 2 additions & 2 deletions web/libs/editor/tests/integration/e2e/audio/audio.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("Audio", () => {
`,
)
.data({
audio: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
audio: "/public/files/barradeen-emotional.mp3",
})
.withResult([])
.init();
Expand All @@ -32,7 +32,7 @@ describe("Audio", () => {
`,
)
.data({
audio: "https://htx-pub.s3.us-east-1.amazonaws.com/examples/audio/barradeen-emotional.mp3",
audio: "/public/files/barradeen-emotional.mp3",
})
.withResult([])
.init();
Expand Down

0 comments on commit ef63bed

Please sign in to comment.